putting form data into a database

Results 1 to 5 of 5

Thread: putting form data into a database

  1. #1
    Join Date
    Dec 1969

    Default putting form data into a database

    I need to know if after what I have done (which I will now explain) I need to actually go into my Access software and there create a database for the data from my form to go into. I have done all of the code to put the form data into my database as far as I can tell. I have had the form data going (via GET) into a querystring that is passed to my ASP page then put into my database through code like:<BR><BR>Set RS=Server.CreateObject(ADODB.Recordset")<BR>Query = "SELECT * FROM tablename"<BR>RS.Open Query, Connect, 3, 3<BR>RS.AddNew<BR>&#039;then setting form fields equal to database fields<BR>RS("LastName") = Request("LastName")<BR>&#039;then updating the record<BR>RS.Update<BR><BR>Then I close everything, etc. That all looks complete. So now my question is - what do I have to do in my Access database software to make a database ready to take in this data? Do I create a database or does the ASP code I just showed you do that on its own? In the following line:<BR><BR>Query = "SELECT * FROM tablename"<BR><BR>if I just put the tablename how is it going to know which access database file to open to get to that tablename? Thank you for any help you can give me. This is my first ASP application and my book is not good so I am a little lost.<BR><BR> <BR>

  2. #2
    peterjl@austec.net.au Guest

    Default RE: putting form data into a database

    You do need to create the database and place it on your server. The folder where you place the db file has to have filesystem read/write access, so your application can use the database, and http access denied, so that the db file cannot be downloaded by visitors.<BR><BR>For your script to communicate with the db, you need to create a connection:<BR><BR>Cnstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(VirtualPathofYourDB) & ";"<BR>Set Connection=Server.CreateObject("ADODB.Connection") <BR><BR>The above creates a DSN-less connection, assuming that you use access 2000. For Access 95 replace "4.0" with "3.51"

  3. #3
    dmitri Guest

    Default additional question

    Cnstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(VirtualPathofYourDB) & ";"<BR>Set Connection=Server.CreateObject("ADODB.Connection") <BR><BR>this script works, but if my Access database is protected with a pathword, how do i write it in the syntax? does anybody know this?

  4. #4
    peterjl@austec.net.au Guest

    Default RE: additional question

    I am not sure of the exact syntax, but something like this:<BR><BR>Cnstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(VirtualPathofYourDB) & ";User=YourUser; Password=Yourpassword"<BR>

  5. #5
    dmitri Guest

    Default Access question

    i used this sintax:<BR>Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mydatabase) & ";User=sa; Password=mypassword"<BR><BR>and it gives this error:<BR>Microsoft JET Database Engine error &#039;80040e4d&#039; <BR><BR>Cannot start your application. The workgroup information file is missing or opened exclusively by another user. <BR><BR>and if i take out the password and user:<BR>Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mydatabase) & ";User=; Password="<BR><BR>it gives the following error:<BR>Microsoft JET Database Engine error &#039;80004005&#039; <BR><BR>Could not find installable ISAM. <BR><BR>do you know how to fix this?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts