I am trying to insert data into a SQL database using a VBScript, but the script will not compile due to an invalid character (the double quote before InitialCatalog).
I have checked the encoding (ANSI), I have tried deleting and retyping the quote to make sure it's not a "curly quote", I have added additional spaces to make sure that the error follows the quotation mark, I have tried replacing the quote with chr(34) and I have even created a new file and retyped the entire script to make sure there was no copy and paste related errors. I am stumped. Here is the entire script:
Const adOpenStatic = 3
Const adLockOptimistic = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open _
"Provider=SQLOLEDB;" & _
"Data Source=******;" & _
"Trusted_Connection=Yes;" & _ "InitialCatalog=ERO;" & _
"User ID=*****;Password=*****;"
objRecordSet.Open "INSERT INTO Documents (RONumber, Description, FileName)" & _
"VALUES ('12345', 'RO', objArgs(0))", _
objConnection, adOpenStatic, adLockOptimistic
Thanks in advance for any help!