W
William
Hi and Thanks in advance for taking a look at my question.
I am using an "include" page with a sub to open a db connection for multiple
Recordsets. My problem is that in some cases I need to use set connection
parameters such as adOpenDynamic, adLockPessimistic, adCmdText.
Is there a way to add these to the "Open Data Connection Command" or to the
"Open Recordset Command"?
Examples Follow
**** Included File ******
<%
'******* Open Connection to MyData
Sub Opendata( DatCon )
Set DatCon = Server.CreateObject("ADODB.Connection")
DatCon.Open "DSN=data04;"
End Sub
'******* Close Connection to MyData
Sub CloseData( DatCon )
DatCon.Close
Set DatCon = NOTHING
End Sub
'******* Open Recordset from DatCon
Sub OpenRs( Sql, rs )
Set rs = DatCon.Execute(Sql)
End Sub
'******* Close Recordset from DatCon
Sub CloseRs( rs )
rs.Close
Set rs = NOTHING
End Sub
%>
********** Original Page info************
Sql = "SELECT * FROM p_CurrentUpdate WHERE CustId = " & StrCusId & " ORDER
BY Timestamp ASC"
OpenRs Sql, rs
StrCurrentUpdate = "True"
If rs.EOF Then
StrCurrentUpdate = "False"
Else
rs.MoveLast
StrCustUpdateLast = rs.Fields("Timestamp").Value
End If
CloseRs rs
*******************
When I execute this code I get [Microsoft][ODBC Microsoft Access Driver] Too
few parameters. Expected 1.
Now, all the Variables and Objects are "Dim" at the top of the page, and if
I don't use the ORDER BY parameter it will work, so I am pretty sure it is
because the proper parameters are not set for DatCon and record interaction.
Please give any assistance you can. Thank you
William
I am using an "include" page with a sub to open a db connection for multiple
Recordsets. My problem is that in some cases I need to use set connection
parameters such as adOpenDynamic, adLockPessimistic, adCmdText.
Is there a way to add these to the "Open Data Connection Command" or to the
"Open Recordset Command"?
Examples Follow
**** Included File ******
<%
'******* Open Connection to MyData
Sub Opendata( DatCon )
Set DatCon = Server.CreateObject("ADODB.Connection")
DatCon.Open "DSN=data04;"
End Sub
'******* Close Connection to MyData
Sub CloseData( DatCon )
DatCon.Close
Set DatCon = NOTHING
End Sub
'******* Open Recordset from DatCon
Sub OpenRs( Sql, rs )
Set rs = DatCon.Execute(Sql)
End Sub
'******* Close Recordset from DatCon
Sub CloseRs( rs )
rs.Close
Set rs = NOTHING
End Sub
%>
********** Original Page info************
Sql = "SELECT * FROM p_CurrentUpdate WHERE CustId = " & StrCusId & " ORDER
BY Timestamp ASC"
OpenRs Sql, rs
StrCurrentUpdate = "True"
If rs.EOF Then
StrCurrentUpdate = "False"
Else
rs.MoveLast
StrCustUpdateLast = rs.Fields("Timestamp").Value
End If
CloseRs rs
*******************
When I execute this code I get [Microsoft][ODBC Microsoft Access Driver] Too
few parameters. Expected 1.
Now, all the Variables and Objects are "Dim" at the top of the page, and if
I don't use the ORDER BY parameter it will work, so I am pretty sure it is
because the proper parameters are not set for DatCon and record interaction.
Please give any assistance you can. Thank you
William