I need to get connected to a database...?

Results 1 to 2 of 2

Thread: I need to get connected to a database...?

  1. #1
    Join Date
    Dec 1969

    Default I need to get connected to a database...?

    I really need help! I am a beginner at this and can&#039;t seem to get access to my database. The following code...<BR><BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;!--#include file="adovbs.inc"--&#062;<BR>&#060;%<BR>Dim song_name_local<BR>Dim ado_conn<BR>Dim connection_string<BR>Dim recordset_conn<BR>Dim sql_statement<BR><BR>song_name_local = Request.QueryString("song_name")<BR>Set ado_conn = Server.CreateObject("ADODB.Connection")<BR>db_path = "../../../my documents/web/djgrax_rebuild_2/order_database/order_database.mdb"<BR>connection_string = "DRIVER={Microsoft Access Driver (*.mdb)} DBQ=" _<BR>& Server.MapPath(db_path)<BR>ado_conn.Mode = adModeReadWrite<BR>ado_conn.ConnectionString = connection_string<BR>ado_conn.CursorLocation = adUseClient<BR>ado_conn.Open<BR><BR>sql_statement = "SELECT db_song_name, db_downloads_mp3, db_downloads_ra " _<BR>& "FROM song_downloads WHERE db_song_name = " & song_name_local &";"<BR>Set recordset_conn = Server.CreateObject("ADODB.Recordset")<BR>recordse t_conn.Open sql_statement, ado_conn, adOpenStatic, adLockOptimistic, adCmdText<BR><BR>recordset_conn.db_downloads_mp3 = recordset_conn.db_downloads_mp3 + 1<BR><BR>produces the following error...<BR><BR>Microsoft OLE DB Service Components error &#039;80040e73&#039; <BR><BR>Format of the initialization string does not conform to the OLE DB specification.

  2. #2
    Join Date
    Dec 1969

    Default bad conntion_string?

    Maybe you should start with hello world. This looks confusing!<BR>try this...<BR><BR>1. replace Server.MapPath(db_path) with just db_path <BR>2. put the absolute path of order_database.mdb in the variable db_path<BR>example: <BR><BR>db_path = "c: ? ? ? my documentswebdjgrax_rebuild_2order_databaseorder_da tabase.mdb"<BR><BR><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