View Single Post
  #3 (permalink)  
Old January 19th, 2005, 02:50 PM
reidcor reidcor is offline
Authorized User
 
Join Date: Jul 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thx much,
I made the changes you suggested and it executes and gives me the
response page as usual but it does not add the info to the dbase.
I'm still learning a little bit here so let me tell you that I got
this VBscript file from someone and I put it into an existing solution
in Visual Studio that has an open connection to the database. I assume
from that, that it should write to the d-base if the code is correct.
Is there anything I should check?--Here is my code after the changes
yu suggested:
----------------
Sub AddReturnData(strMsg)
DIM adoConnection, strSQL
DIM arrValues(8)
SET adoConnection = Server.CreateObject("ADODB.Connection")
adoConnection.ConnectionString = "Driver={SQL Server}; Server=local\thePhile; Database=thePhile; UID=sa; PWD=xxx"
strSQL = "INSERT INTO Transactions_TransactionLogJSForm(TransactionType, TotalAmount, Name, CompanyName, ResponseType, ResponseCode, ResponseDescr, AuthCode, TraceNo)"
strSQL = strSQL & "VALUES(""" & ParseString(strMsg, "pg_transaction_type=") & ""","""
strSQL = strSQL & ParseString(strMsg, "pg_total_amount=") & ""","""
strSQL = strSQL & ParseString(strMsg, "pg_name_first=") & ""","""
strSQL = strSQL & ParseString(strMsg, "pg_name_last=") & ""","""
strSQL = strSQL & ParseString(strMsg, "pg_response_type=") & ""","""
strSQL = strSQL & ParseString(strMsg, "pg_response_code=") & ""","""
strSQL = strSQL & ParseString(strMsg, "pg_response_description=") & ""","""
strSQL = strSQL & ParseString(strMsg, "pg_authorization_code=") & ""","""
strSQL = strSQL & ParseString(strMsg, "pg_trace_number=") & ")"
Response.Write strSQL
adoConnection.Execute(strSQL)

adoConnection.Close
adoConnection = Nothing
End Sub
-----------------
Thanks again for your help.
Reid C.

Reid C.
Reply With Quote