I am accessing and Oracle 8.05 database from an ASP. My problem is that it is doing double connections. This causes an error on SQL inserts with duplciate keys, as the first one inserts fine, but then it tries to do it a second time and I get a "duplicate key" error.
The code is as follows:
<DB Code in include file>
Set mConn = CreateObject("ADODB.Connection")
mConn.Open "Provider=MSDAORA; Data Source=test; User ID=user;
Set mConn = Nothing
Set GetRecordset = CreateObject("ADODB.Recordset")
Set GetRecordset = mConn.Execute(pstrSQL)
<Where this code is called>
Dim rsUser, strSQL, flAccessAllowed
strSQL = "select user_id from users where user_id = UPPER('" & strUser
Set rsUser = GetRecordset(strSQL)
If not rsUser.bof and not rsUser.eof then
flAccessAllowed = true
Set rsUser = nothing
strSQL = ""
There's no problem when "strSQL" is a select. When "strSQL" is an insert statement, this is where the error occurs. Has anyone seen this before and/or know why it is happening? I can look at the active sessions through Toad and it always creates two connections, even for just the above select.