|
-
Jan 10th, 2005, 04:32 AM
#1
Thread Starter
Addicted Member
Connection Problem
hello i have a database n i want to connect to it using ADODB.connection, this is the code i use
Dim con As New ADODB.Connection
Dim data As New ADODB.Record
data.Open "select * from table1", con
MsgBox data.fields(0)
but it says "The connetion can't be used to perform this operation, it is either closed or invalid in this context"
-
Jan 10th, 2005, 04:33 AM
#2
Thread Starter
Addicted Member
Re: Connection Problem
sorry this is the actual code i use
Dim con As New ADODB.Connection
Dim data As New ADODB.Record
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\My Documents\db1.mdb;Persist Security Info=False"
data.Open "select * from table1", con
MsgBox data.fields(0)
-
Jan 10th, 2005, 05:07 AM
#3
Addicted Member
Re: Connection Problem
try
VB Code:
Dim data As New ADODB.RecordSet
nickname
Software Engineer
DBA
Webdesigner
--
to code or to be coded, that's the question
-
Jan 10th, 2005, 05:18 AM
#4
Thread Starter
Addicted Member
Re: Connection Problem
thnkx ... actually i figured it out maself that i shud have used Recordset instead of Record
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|