I'm creating a Microsoft Access 2010 database that will be part of a small web site for a client. I've debugged it with message boxes and I'm able to accept the data with the VBScript (client's choice as they are willing to update/maintain the web site contents), I'm able to call the sub that sends the data to the database, but I can't get past the connection to the database. Here's what I have:
Sub InsertIntoDatabase(FullName)
Dim strSQL, strConnect, strSQL2, i
Dim conn
Set conn = CreateObject("ADODB.Connection")
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\userID\Desktop\My Stuff\MyData.accdb"
' Cannot get past this point. It's like I cannot connect to the path above.
conn.Open strConnect
strSQL = "INSERT INTO SurveyData (FullName, Address, City, State, Zip, Phone, Email, Pentium, PentiumMMX, Macintosh, Series486, Series386, Win2000, WinNT, WinXP, WinVista, Win7, Unix, Shopping"
strSQL2 = ") VALUES ('" & FullName & "', '" & Address & "', '" & City & "', '" & State & "', '" & Zip & "', '" & Phone & "', '" & Email & "', '" & Pent & "', '" & PentMMX & "', '" & Mac & "', '" & PC486 & "', '" & PC386 & "', '" & Win2000 & "', '" & WinNT & "', '" & WinXP & "', '" & WinVista & "', '" & Win7 & "', '" & Unix & "', '" & Shopping & "'"
' End the query string
strSQL = strSQL & strSQL2 & ")"
' Send the query to the database
conn.Execute strSQL
' Close the connection to the database
conn.Close
strSQL = ""
end sub
I have another web site that uses a similar script and that one works. Can anyone see something I'm missing?