Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

changed from dsn to dns-less, now not working

Posted 22 Apr 2002 01:33:42
1
has voted
22 Apr 2002 01:33:42 Dave Clarke posted:
I have been developing a site using dsn connections to 2 databases and everything works fine locally with IIS. However the server that i want to upload to insists on dns-less so i have created connection with the following strings

<b>var MM_connmessages_STRING = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/davecl/database/reunite.mdb"</b>

and

<b>var MM_connusers_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/davecl/database/useraccess.mdb"</b>

when i test them in UD it says connected successfully, now when i view my pages using F12 i get the following error

<b>Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/davesnewreunite/TMP1lzduuxepa.asp, line 27</b>

this is line 26 to 33


<b>var Recordset2 = Server.CreateObject("ADODB.Recordset";
Recordset2.ActiveConnection = MM_connmessages_STRING;
Recordset2.Source = "SELECT * FROM Messages ORDER BY WhoAreYouLookingFor ASC";
Recordset2.CursorType = 0;
Recordset2.CursorLocation = 2;
Recordset2.LockType = 3;
Recordset2.Open();
var Recordset2_numRows = 0;</b>

anybody any ideas? or am i being thick and it's really easy?

thanks, Dave

Edited by - Davecl on 22 Apr 2002 01:48:22

Replies

Replied 23 Apr 2002 01:33:55
23 Apr 2002 01:33:55 David Thomas replied:
Hi,
I've had a few problems with this myself, and the only way i could get around it, is to delete all the asp code generated on the pages that were using a DSN connection, and redoing them with the connection string.

Also when modifying a connection from say logon to logon2, the connection string i.e
Recordset2.ActiveConnection = MM_connmessages_STRING; stays at logon1, so i have to manually insert a 2 at the end of connection name.

I also noticed a post on here recently that stated SQL would have problems trying to open 2 databases on the same page at once, you might wanna check that out.

I've most probably been no help, but it's worth a shot.


"Those who think they know it all, in fact no nothing at all" - Me!
Replied 23 Apr 2002 11:14:38
23 Apr 2002 11:14:38 Dave Clarke replied:
thanks a lot davie

will try redoing <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>

will take a look at the 2 database thing aswell , thanks

Dave
Replied 23 Apr 2002 20:10:09
23 Apr 2002 20:10:09 scre wdanger replied:
Hi dear,
on the server use back slash "\" instead of normal "/". This should help you.
Otherwise try this one:


strDbPath = Server.MapPath("." & "\your database directory\database.mdb"
ConnectStr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & strDbPath & ";PWD=*******"
Replied 24 Apr 2002 17:06:13
24 Apr 2002 17:06:13 Dave Clarke replied:
thanks screwdanger

will have a look at that

Dave

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hi dear,
on the server use back slash "\" instead of normal "/". This should help you.
Otherwise try this one:


strDbPath = Server.MapPath("." & "\your database directory\database.mdb"
ConnectStr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & strDbPath & ";PWD=*******"
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 06 Feb 2006 13:55:11
06 Feb 2006 13:55:11 Hans Gelok replied:
This worked for me!

I was using Windows 2003 server with 'old-school' ODBC which was giving errors (when going out of the root). Replacing \ for / did the job,

Thanks!

Reply to this topic