I am trying to take information from a HTML Form and input into an Excel File (xlsx) with ASP / VBScript (not VB.NET). I have some experience in Java and PHP but am new to the VB world. Sofar I have found ways to get the Data from the GET/POST methods. Now I am trying to create an ADO connection to the excel file. here is my code so far:
Dim cn as ADODB.Connection
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.ACE.OLEDB.12.0"
.ConnectionString = "Data Source=EXCEL_FILE.xlsx;" & _"Extended Properties=Excel 12.0 Xml;HDR=YES"
.Open
End With
I got the connection String from here: connectionstrings.com and tried to stick to this guide: http://support.microsoft.com/kb/257819/en-us But no luck up until now. So here are my questions:
1) Is this the right idea in general? So grabbing the Data from POST for example and then opening a connection with ADO to the excel file and adding the info with queries on the connection object?
2) Any obvious flaws in the code ?
3) Would be great if someone could outline a solution, writing data from a HTML Form into an Excel file.
Thanks in advance.
Edit: Ok Here is the code I try:
Dim cn
Set cn = Server.CreateObject("ADODB.Connection")
With cn
.Provider = "Microsoft.ACE.OLEDB.12.0"
.ConnectionString = "Data Source=EXCEL_FILE.xlsx;Extended Properties=""Excel 12.0 Xml;HDR=YES"""
'From : http://www.connectionstrings.com/excel-2007
.Open
End With
Once I call "Open" on cn it gives me a 500 internal Error. I am not sure if I am making an obvious mistake, but since I don't know where to find error logs I don't have a clue where to start looking.