| Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free! |
Using VB Prog to access Database Online
|
Original Message
|
Name: JD
Date: May 17, 2002 at 01:28:01 Pacific
Subject: Using VB Prog to access Database Online |
Comment: 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.mdb From 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.mdb I need it to be: http://www.database.com/database.mdb How can i connect to this server and add and update my database...thanks in advance
Report Offensive Message For Removal
|
|
Response Number 2
|
Name: Alexander Zhadanov
Date: May 24, 2002 at 13:59:04 Pacific
|
Reply: (edit)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
Report Offensive Follow Up For Removal
|

Post Locked
This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
Go to Programming Forum Home