I need help from someone who is successfully connecting to MS Access databases on a Windows server at Hostony.
I've just done bits of code & db work from time to time and obviously don't know enough. I read online tutorials and am trying things out. I'm OK with SQL. I would like to work with Access databases because I have MS Office Pro on my computer and have written some programs in VB for Access and would like to keep learning/working with it.
I took sample code from Microsoft's asp tutorial and am testing the very simplest asp page with a form to enter new data into an Access table. But it does not work. I know that's my fault and I'm at idiot level here. But please, could someone give me SAMPLE CONNECTION STRINGS - all the first info in a working asp script - that you know works on this set up? When I take examples from around the web, of course it doesn't come out quite right. ...
http://patp.us/forminput.asp
I have created an MS Access database, HAWKINS.mdb
ODBC DSN = genealogy
ODBC DSN Type: MS Access
file = db\HAWKINS.mdb
There are two tables, one I will eventually use, and the test one straight from Microsoft: MyUsers
I don't want a password so there is no user name or password set, thus the empty strings below in Open.
in the asp page:
<%Dim cConn, sSQL
Set cConn = Server.CreateObject ("ADODB.Connection")
cConn.Open "dsn_genealogy","",""
what more do I need before creating my SQL statement?
(this nonsense straight from MS tutorial):
sSQL = "INSERT INTO MyUsers (Name, Email)"
sSQL = sSQL & " VALUES ('" & Request.Form("Name") & "','" & Request.Form("Email") & "')"
cConn.Execute sSQL
Notice I haven't referenced the table, only the DSN ...