ODBC error

Results 1 to 7 of 7

Thread: ODBC error

  1. #1
    diedre Guest

    Default ODBC error

    Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR><BR>[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified <BR>...Is everything okay here? why Am I getting this error?<BR><BR>&#060;%<BR>set conn = server.createobject ("ADODB.Connection")<BR>conn.open "polls"<BR>set polls=conn.execute (SQL)

  2. #2
    Join Date
    Dec 1969

    Default RE: ODBC error

    So *did* you set up a System DSN for your "polls" database???<BR><BR>If not, go to the Control Panel and the ODBC32 or ODBC subpanel and set it up.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default QRE: ODBC error

    If you have already set up your datasource in ODBC administrator<BR>then your connection string may need a more complete path. Here is an example that you can use:<BR><BR>&#060;%<BR>DIM strConnect as string<BR>strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=path to database/db1.mdb;pwd=yourpassword"<BR>%&#062;<BR><BR>The path to your database is where its located on the server. example: DBQ=D:websitefolderdatafolderdb1.mdb<BR><BR>You can save this as an include file in any asp page. -- hope this helps.<BR><BR>Don&#039t forget the quotes -- its a string.

  4. #4
    diedre Guest

    Default RE: ODBC error

    YES. The DSN is called polls. Should it not be the same name as the DB? Thanks for the example...<BR><BR>Diedre

  5. #5
    Claes Guest

    Default RE: ODBC error

    Try<BR><BR>conn.open "DSN=polls"<BR><BR>Claes

  6. #6
    diedre Guest

    Default string connect error...help

    Here is the code:<BR>&#060;%<BR>DIM strConnect as string<BR>strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=path to election/polls.mdb;pwd=yourpassword"<BR>%&#062;<BR>&#039My DB is "polls" located in the root directory<BR><BR>Here is the Error:<BR><BR>Microsoft VBScript compilation error &#039 800a0401&#039 <BR><BR>Expected end of statement <BR><BR>/election/pp.ASP, line 18 <BR><BR>DIM strConnect as string<BR>---------------^<BR>

  7. #7
    Scott S Guest

    Default RE: string connect error...help

    I dont know if this will completely solve your problem but, <BR>In VBScript (asp) all variables are of Type Variant. You cannot declare variables as one type or another, so where you have<BR> <BR>dim strconnect as string &#039this will cause an error, vbscript has no concept of something being declared as string (or anything else)<BR><BR>it should be: <BR>dim strconnect &#039as string &#060;-- the As String is commented out, you dont need it, but will help you keep the code straight.

Posting Permissions

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