
/Common.asp, line 177
|
| Posted: 10/14/2004, 6:17 PM |
|
I keep getting the following error when inserting a record using the Codecharge DBCLS to insert a record into the database.
Basically I am inserting a transaction Record via a function and getting the ID by using the following bit of code. The Function is called on a before Show event on the page
Function Insert_Transaction(OrgID,LeadSession,UserSession,FPayment_Method,Currency_Type)
Dim LeadType
LeadType = "Website"
if CCGetGroupID() > 1 then LeadType = "Extranet"
if Len(UserSession) = 0 then UserSession = 0
Dim conn,varNewID,rsNewID
Set conn = New clsDBprodive
conn.execute("Insert into tblTransaction(LeadID,LeadType,Payer_ID,PaymentMethod,UserID,Transaction_Code,Currency_Type)Values(" & LeadSession & ",'" & LeadType & "'," & OrgID & ",'" & FPayment_Method & "'," & UserSession & ",'" & session.sessionID & "'," & Currency_Type & ")")
Set rsNewID = conn.Execute("SELECT @@IDENTITY as intIdent") ' Create a recordset and_SELECT the new Identity
If Not rsNewID.EOF Then
varNewID = cint(rsNewID("intIdent"))
response.write("<br> the Value = " & varNewID)
else
response.write("<br> The @@IDENTITY Call did not Work!")
response.end()
End IF
Set rsNewID = Nothing
'Return the Transaction id
response.Write("<br> the Trans value = " & varNewID)
Insert_Transaction = conn("pkTransactionID")
response.end
conn.Close
Set conn = Nothing
End Function
The is code was running no problem on access, but since moving to sql server 2000, it does not seem to function the same. I have checked the user roles etc, and everything appears to be correct.
Help
Ben
|
|
|
 |
BenUltra2
|
| Posted: 10/14/2004, 6:43 PM |
|
please ignore the post, as obviously I should open the connection before trying to insert a record. Just one of those days.
Ben
|
|
|
 |
|

|
|
|
|