Results 1 to 3 of 3

Thread: connecting a db using asp and ado - newbie

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Posts
    25

    Angry

    Hi

    I bought some cheap web space the other day on an NT server so I could play around with ASP and databases.

    I am trying to upload an Access database - ( I'll use SQl server once i know what I'm doing

    The company gave me this as an instruction

    "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.mappath("/")\ &
    "<dbname>.mdb;DefaultDir=" & Server.mappath("/")\ & "
    \<username>;DriverId=25;FIL=MS
    Access;MaxBufferSize=512;PageTimeout=5;UID=<username>;PWD=mypassword"
    (the above must be placed on one line)

    The idea is that I put the above in ADO connection string so saying that my db is called DBtest.mdb and my username is mfoster, how should I fill out my connection string and do I upload the mdb file to my mfoster root directory on the server

    i can't get my head around the mappath function so I'm not sure what I should be filling in !
    I hope this makes sense to someone

    thanks
    Mark

  2. #2
    Hyperactive Member Kagey's Avatar
    Join Date
    Sep 2000
    Location
    The Wilderness of New Brunswick
    Posts
    294
    I use this connection string to connect to my database. Make sure you rename db.mdb to your database name, and the username and password appropriatly.

    Code:
    Set Conn = Server.CreateObject("ADODB.Connection")
        
    Conn.Open "DBQ=" & Server.Mappath("db.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};UID=USERID;PWD=PASSWORD"
    if you have anymore questions, just reply.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Posts
    25
    Hi

    That worked perfectly - many thanks

    Mark

Posting Permissions

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



Click Here to Expand Forum to Full Width