Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A real puzzler....

Status
Not open for further replies.

snoopy75

Technical User
Aug 24, 2001
340
US
Alright, ODBC experts, riddle me this... Why would this work:
Code:
Recordset1.ActiveConnection = "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Inetpub\[URL unfurl="true"]wwwroot\Shoetag\Shoetag.mdb;uid=admin;pwd=hill;"[/URL]
but not this:
Code:
Recordset1.ActiveConnection = "dsn=shoetag;uid=admin;pwd=hill;"
??????????

--Ryan
 
Hi ...
do you have a System DSN in your ODBC Data source administrator named "shoetag" ?
and if so, what is the settings of it ?
----
TNX.
E.T.
 
Thanks for your response! Yes, there is a data source named "shoetag" set up, assigned to "C:\Inetpub\ using the Microsoft Access Driver, with a username of "admin" and a password of "hill". That's what boggles me. It should work the same, right? Are there any other settings I need to look at in the administrator?

--Ryan
 
Hi ...
OK ...
and what is the error when you use ODBC ?
----
TNX.
E.T.
 
Not to insult anyone's intelligence, but did you check that the DSN works in the ODBC window? (Click Test Connection)
 
Hi all,
I did indeed do the Test Connection, and it says that it works fine, and in fact, it does work fine the very first time. After that, though, I get this:
Code:
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

--------------------------------------------------------------------------------

Please try the following:

Click the Refresh button, or try again later.

Open the localhost home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Provider (0x80004005)
Unspecified error
/liftingdevices/TMP3nrlz3d0r4.asp, line 8


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)

Page:
GET /liftingdevices/TMP3nrlz3d0r4.asp

Time:
Wednesday, October 02, 2002, 9:09:17 AM

More information:
Microsoft Support

Funny thing about it is, if I keep hitting Refresh every second or so, the page will successfully load once in about 6 or 7 tries, but the rest of the time, I get the above error message. If I construct the connection string the other way (without using a dsn), it loads successfully 100% of the time. Very odd, no? Is there something wrong with Windows or IIS? Or is there a setting I'm missing in my inexperience? Thanks for your help.

--Ryan
 
Hmmm i don't know if this would be necessary, but worth a try. What if you put the database name in the connection line like so.

"dsn=shoetag;database=shoetag;uid=admin;pwd=hill;"

page loads once in about the 6 or 7 trys.... wonder if the database is locking and you can't access it so you're getting the error message? i don't know i'm just throwing ideas around. if so, go to the system dsn, click configure, advanced and change the page timeout from 5 to 5000
 
Hmm... Just guessing, but it could be a connection pooling issue. When a connection is first created, it can be used. After that, the connection is pooled. The second time you attempt to connect to the database, it attempts to activate the pooled connection, and for whatever reason, it gets an error. After 6 or 7 refreshes, enough time has passed for the pooled connection to expire, which causes the ADO API to instantiate a new connection, which works.

What do the ODBC experts think about that?

What are your connection pooling settings for the Access ODBC driver?

Why not change your connection string to use the OLEDB driver instead?
 
Don't know if this is too late, but I had the same problem, and all I did was take out the DSN= part:

Recordset1.ActiveConnection = "shoetag;uid=admin;pwd=hill;"

And it worked like a charm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top