Forums

This topic is locked

Multiple custom connection strings?

Posted 17 Jun 2002 23:23:33
1
has voted
17 Jun 2002 23:23:33 dave ingraham posted:
Hi,
I'm trying to develop an online application form that reads and writes to multiple tables in a database, using custom connection strings to connect to the database. Everything is fine as long as I only have one recordset, but if I try to add another recordset, I get the following error:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Could not use '(unknown)'; file already in use.
/USA/self_start/supplier_list.asp, line 16

I thought that maybe my problem was that I was trying to use the same connection string for both recordsets, but even after creating a new connection string document, the page still errors.

Is it not possible to have multiple connections using custom connection strings?

Replies

Replied 18 Jun 2002 01:50:27
18 Jun 2002 01:50:27 Andrew Watson replied:
Yes, its ok to do this, post some code and well see what the beef is.

:: Son, im Thirty.... ::
Replied 18 Jun 2002 16:40:38
18 Jun 2002 16:40:38 dave ingraham replied:
Thanks leed.

I guess I should have stated that I'm using Access for the DB.

I was having trouble putting the entire code in this forum, so here's a link to a text file version:

www.ingrahamdesign.com/ghx/code.txt

Here's the code produced by UD for the two connections:

set online_registration = Server.CreateObject("ADODB.Recordset"
online_registration.ActiveConnection = MM_online_registration_STRING
online_registration.Source = "SELECT * FROM main1 WHERE id = " + Replace(online_registration__MMColParam, "'", "''" + ""
online_registration.CursorType = 0
online_registration.CursorLocation = 2
online_registration.LockType = 3
online_registration.Open()
online_registration_numRows = 0

set supplier = Server.CreateObject("ADODB.Recordset"
supplier.ActiveConnection = MM_supplier_list_STRING
supplier.Source = "SELECT * FROM supplier"
supplier.CursorType = 0
supplier.CursorLocation = 2
supplier.LockType = 3
supplier.Open()
supplier_numRows = 0

Where "online_registration" is the name of my first recordset and "supplier" is the name of my second recordset.
Replied 18 Jun 2002 18:21:33
18 Jun 2002 18:21:33 dave ingraham replied:
ok, never mind. Full permissions weren't set on the DB. Works now. d'uh.

Reply to this topic