My goldfish won't help me here . . .newbie DB question

Results 1 to 3 of 3

Thread: My goldfish won't help me here . . .newbie DB question

  1. #1
    Join Date
    Dec 1969
    Posts
    9

    Default My goldfish won't help me here . . .newbie DB question

    &nbsp;<BR>This question is easy for you guys but I´m stuck!<BR><BR>I´m in Haneng´s Lesson 17--just starting, but my code<BR>&#060;%<BR>Set MyConn = Server.CreateObject("ADODB.Connection")<BR>MyConn. Open "FILEDSN=n:dsnmytable_dsn.dsn"<BR>&#037;&#062;<BR> Gives me the error<BR>General error: Invalid file dsn ´n:dsnmytable_dsn.dsn´ <BR>All of my files are in my "n" drive, which is our web drive so that I can test files on our intranet. This should work, right?<BR>I know it sounds lame, but I have to start somewhere and have no other help!

  2. #2
    Join Date
    Dec 1969
    Posts
    35

    Default RE: My goldfish won't help me here . . .newbie DB question

    If you are going to be using the ADODB object for your database connection there need to be an entry in the Web Server&#039s ODBC service for that database. This can be found in the control panel of the Web Server (Look for ODBC Data Sources). Then follow the easy instructions on how to set up the Data Source connection. Then in the like that reads "MyConn.Open" the information that follows should be the name of the ODBC Data Source that you created.<BR>Ex: the ODBC Data Source is named "MyDSN" then the MyConn.Open line should read...MyConn.Open "MyDSN"<BR><BR>Happy Programming =)

  3. #3
    Join Date
    Dec 1969
    Posts
    672

    Default RE: My goldfish won't help me here . . .newbie DB question

    No, you need to have the local path to the database. Network drives will not work.You can update your code to this if you do not know the local path:dbpath="DBQ=" & server.mappath("db.mdb")MyConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & dbpath
    ________
    big women Webcam
    Last edited by Jay; 04-16-2011 at 01:27 AM.

Posting Permissions

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