variable in DB call

Results 1 to 2 of 2

Thread: variable in DB call

  1. #1
    Join Date
    Dec 1969

    Default variable in DB call

    I am using the below code:<BR><BR> Set MyConn = Server.CreateObject("ADODB.Connection")<BR> set ors = server.createobject("adodb.recordset")<BR> joe = "E:homeintelgapublic_htmladdpagesgamedescript.mdb" <BR> MdbFilePath = joe<BR> MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";" <BR> ChooseGame = """Select * FROM tblGameDescription WHERE Name ="<BR> ChooseGame = ChooseGame & request.form("Name") & """<BR> ors.Open ChooseGame, MyConn<BR><BR>and it won&#039t open (doesn&#039t give opening error), instead, whenever I call a value (like ors("Name") ) doesn&#039t write anything.<BR><BR>the end result should be:<BR><BR>ors.Open "Select * FROM tblGameDescription Where Name=&#039variablegivenbyform&#039, MyConn<BR><BR><BR>I need to open a given a record X, where X is a primary key in the table. The value of X is given from previous form.<BR><BR>How should I restructure?

  2. #2
    Join Date
    Dec 1969

    Default RE: variable in DB call

    Perhaps try something like:<BR>MdbFilePath = Server.MapPath(joe)<BR><BR>Best regards,<BR>-Paul

Posting Permissions

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