Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Heres the deal:
Im using a visual basic 6 program that I want to store a username and a password in a database. Now the database is going to be an online database..not residing on the same computer as the program. How can i access the database if say the address is: http://www.database.com/database.mdbFrom the program I want to connect to this database, add username and password and update it.
heres a sample of how I did it when the database was on my computer:
_____________________________________________
Public Sub openANDupdateDB()
Dim db As ADODB.Connection
Set db = New ADODB.Connection
Dim primaryRS As ADODB.Recordset
Set primaryRS = New ADODB.Recordset
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:\WINDOWS\Desktop\databases\UserInfo.mdb;"
primaryRS.Open "PlayerStats", db, adOpenStatic, adLockOptimistic
primaryRS.AddNew
primaryRS("UserName") = name
primaryRS("Password") = pass
primaryRS.Update
primaryRS.MoveNext
databaseBool = True
primaryRS.MoveLast
primaryRS.Close
db.Close
_____________________________________________
This works fine but now instead of the source being: C:\WINDOWS\Desktop\databases\UserInfo.mdbI need it to be:
http://www.database.com/database.mdbHow can i connect to this server and add and update my database...thanks in advance

You can't directly open database over the internet. But you can use Microsoft RDS object to access data.
You need to create server COM object which
access data locally on a server and expose
some public methods which do work like adding
users to the table.
Add reference to the Microsoft Remote Data services on a client computer.
On a client side you use such :
dim rs as new RDS.DataSpace
set oRemote = rs.CreateObject("yourserverproject.yourclass","http://www.database.com")
and then use methods of this object:
oRemote.Adduser "UserId","Password"
I hope this help.
Alex

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |