Help - Search - Members - Calendar
Full Version: MS Access database connections
Hostony Board > General > Anything and Everything
pat
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. ...
sad.gif
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 ...
MartinB
QUOTE(pat @ Jan 24 2005, 04:35 PM)
I need help from someone who is successfully connecting to MS Access databases on a Windows server


is that possible ?? biggrin.gif
aircraftcarryur
Successfully? I don't know...

You need to create a DSN in your HELM control panel. Beware, hostony's asp engine is very fragile. I sent them the JET 4.0 interface driver update recently which they installed and has helped somewhat. Nonetheless, trying to use an access databse of any size with mroe than 2 users will almsot definately overload the engine resulting in all asp pags on your server to freeze. You them must submit a trouble ticket to get them to restart the asp engine.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here