Database Connection

Results 1 to 2 of 2

Thread: Database Connection

  1. #1
    Jing Guest

    Default Database Connection

    Original Code:<BR>Set Conn1 = Server.CreateObject("ADOBE.Connection")<BR>Conn1.O pen ("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("mydb.mdb"))<BR><BR>Now I want to convert it to,<BR>Conn1.provider="Microsoft.JET.OLEDB.3.51"<B R>"data source")= ...<BR>how to put in.. since the database file is not on my pc(C:driver or D: driver, etc).. but my isp&#039s hosting server?? basically, i want to retrieve the autonumber which just been created in a new record, and then store it as a foreign key to the other two tables. as the article in here said, only can use Recordset.Addnew.. follow with KeyID = Rs("ID"), to get the last record&#039s auto generated index key. however, the article only assume that the source data is in "c:interpubwwwroot..." or is there any other better way to do.. ooh.. i am using ACCESS97 as you can see from my syntax.

  2. #2
    Join Date
    Dec 1969

    Default RE: Database Connection

    you would do something like this.<BR><BR>Conn1.Open ("Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" & Server.MapPath("mydb.mdb"))<BR><BR>if your database is not in the root part of the web then just add the folder it is in Server.MapPath("datamydb.mdb")<BR><BR>Hope this helps.<BR>

Posting Permissions

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