Mailade killen som skrivit koden och fick detta svar:
objDB is a public object for a database abstraction class. There are several levels to the software, with most actual database work organized in classes. I would recommend you place your database work in the relevant class or create a new one to keep the code all organized in the same way.
About using the abstraction class, objDB.Execute is for executing a statement that returns nothing. That function will only execute and returns True/False for if the code was a success (no VBScript errors) or not (VBScript errors).
If you wish to open a recordset, you need to use the objDB.OpenRS function, passing first the recordset name and second the SQL statement. You will later need to close the recordset with objDB.CloseRS and close the database (but not the database abstraction class) with objDB.Close.
Ex:
sqlString = "SELECT @@IDENTITY"
objDB.OpenRS objIdentRS, sqlString
If Not objIdentRS.EOF Then
intIdent = objIdentRS(0)
End If
objDB.CloseRS objIdentRS
objDB.Close
Nu har jag försökt med detta:
sqlString = "INSERT INTO Operators (O_CreateDate, O_Username, O_Password, O_Name, O_Icon, O_Email, O_Status, O_Feedback, O_TotalFeedback, O_TotalHandled, O_Activity) VALUES (" & _
strDate & "," & _
"'" & strInUsername & "'," & _
"'" & strInPassword & "'," & _
"'" & strInName & "'," & _
"'" & strInIcon & "'," & _
"'" & strInEmail & "'," & _
"0,0,0,0,0)"
objDB.Execute(sqlString)
strSQL = "SELECT @@IDENTITY"
objDB.OpenRS objhamtaIDRS, sqlString
intOID = objhamtaIDRS(0)