ADO ConnectionString Strange Errors...HELP! 
Author Message
 ADO ConnectionString Strange Errors...HELP!

I swear, sometimes ADO is more trouble then it's worth...

I'm using VB6, SP3.  I'm using the ADO data control to get data from an
Access 97 database.  When I create a connection string through the property
box, everything works ok.  But when I remove the hardcoding and create the
string programatically, I get this error:

[ODBC Manager]: Data Source Name not found, and no default driver selected.

It's not a VB or ADO error.  And it only appears when I remove the
connectionstring property from the ADO Connectionstring property box.

My code looks like this:

szConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & PIdata &
";Mode=Read|Write|Share Deny None;Persist Security Info=False"

Adodc1.ConnectionString = szConnString
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM [PatientInfo] "
Adodc1.Refresh

In the szConnString line, the PIdata is the fully qualified path (ie:
C:\blah\foo.mdb)  I know PIdata is correct, because I use it with the
regular Data controls with no problem.

Any ideas on what the hell is going on?!?!?  I've been ripping through the
MSDN disks, but I haven't been able to find anything...

Thanks in advance,

Robert



Tue, 08 Oct 2002 03:00:00 GMT  
 ADO ConnectionString Strange Errors...HELP!
Quote:

> I swear, sometimes ADO is more trouble then it's worth...

> I'm using VB6, SP3.  I'm using the ADO data control to get data from an
> Access 97 database.  When I create a connection string through the property
> box, everything works ok.  But when I remove the hardcoding and create the
> string programatically, I get this error:

> [ODBC Manager]: Data Source Name not found, and no default driver selected.

> It's not a VB or ADO error.  And it only appears when I remove the
> connectionstring property from the ADO Connectionstring property box.

<snip>

  I copied and pasted your code, changed only the table name.  Filled

code works fine for me.
  Lemme ask ya this: when you used Adodc1's Property Pages to build your
ConnectionString, did you also fill in its RecordSource property page
with your SQL statement (or select a table)?  You mentioned you removed
the ConnectionString property from the Adodc property box.  If you had
the RecordSource page filled in (either CommandText or selected Table)
and didn't remove that from the property page, that could be the source
of your problem.
  Hope this helps.
--
Jim in Cleveland
If you're writing to me, in my address
change "REAL_Address.see.below" to "worldnet.att.net"
 ((("What's so funny 'bout peace, love & understanding?" - Nick Lowe)))



Wed, 09 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need help debugging ADO error -- VERY Strange

2. Strange ADO Error Please HELP!!

3. Subreports Question - ADO - Strange Error

4. Strange ADO error

5. ADO giving strange error

6. Strange error with VB/VFP and ADO

7. Strange ADO error

8. Strange Error - Running Stored Procedures through Visual Basic 6 and ADO

9. Strange error after upgrading to ado 2.5

10. Strange error with ADO adAsyncExecute

11. Strange ADO error messages coming from our server.

12. Strange Strange Error

 

 
Powered by phpBB® Forum Software