Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connecting to a data source
Message
From
22/05/2002 09:41:26
 
 
To
All
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Connecting to a data source
Miscellaneous
Thread ID:
00659879
Message ID:
00659879
Views:
48
The following code, designed to connect to an Access Database, and populate a textbox with a value from a field(Name) in Table1. I keep getting the following message: "database '\pda.cdb' does not exist. It does exist. I have placed it in the working directory and also at the root of d: and modified the line to connDatabase.ConnectionString = "data source=d:\pda.cdb"

PLEASE HELP!!!!!!!!!!!
Private Sub Command1_Click()
Dim connDatabase
Set connDatabase = CreateObject("ADOCE.Connection.3.0")
connDatabase.ConnectionString = "data source=\pda.cdb"
connDatabase.open

Dim rs 'Create a variable for the Recordset object reference
Set rs = CreateObject("adoce.recordset.3.0")
rs.open "table1"
Me.Text1.Text rs.Fields("firstfield").Value
rs.Close
Set rs = Nothing

connDatabase.Close
Set connDatabase = Nothing

End Sub
Here's to alcohol...the cause of ... and solution to ... all of life's problems - - Homer J. Simpson
Next
Reply
Map
View

Click here to load this message in the networking platform