1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

database connection prob - please help

Discussion in 'C#' started by MichelleByfield, Aug 21, 2008.

  1. #1
    Hi i need to know how to convert the database connection from an frontpage connection to a standard one as i am having trouble. i dont have frontpage extension on my new server, so i need to know how to Server.MapPath ( see below what i thought woudl work)

    this is the connection i have now
    SEMrush
    <!--#include file="_fpclass/fpdblib.inc"-->
      <%
    fp_sQry="SELECT * FROM Sheet1 WHERE (artist = '::artist2::')"
    fp_sDefault=""
    fp_sNoRecords="<tr><td colspan=20 align=left width=""100%"">This show is currently unavailable or only taking private function enquiries.</td></tr>"
    fp_sDataConn="vfe"
    fp_iMaxRecords=256
    fp_iCommandType=1
    fp_iPageSize=0
    fp_fTableFormat=True
    fp_fMenuFormat=False
    fp_sMenuChoice=""
    fp_sMenuValue=""
    fp_iDisplayCols=20
    fp_fCustomQuery=False
    BOTID=0
    fp_iRegion=BOTID
    %>
    <!--#include file="_fpclass/fpdbrgn1.inc"-->
     
    
    <%=FP_FieldVal(fp_rs,"bio2")%> 
    
    Code (markup):
    this is the code that i thought would do the job
     <%
      DIM objConn
      Set objConn=Server.CreateObject("ADODB.Connection")
      objConn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&_
      Server.MapPath ("\fpdb/vfe.mdb")&";"
      objConn Open
      
      DIM mySQL
      mySQL="SELECT * FROM Sheet1 WHERE (ID = ::ID::)"
      
      DIM objRS
      Set objRS=Servier.CreateObject("ADODB.Recordset")
      objRS.Open mySQL, objConn
      %>
    Code (markup):
     
    MichelleByfield, Aug 21, 2008 IP
    SEMrush
  2. 50plus

    50plus Guest

    Messages:
    235
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <%
    ID = (whatever gives the ID number, form field, query string ... etc)

    DIM objConn
    Set objConn=Server.CreateObject("ADODB.Connection")
    objConn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&_
    Server.MapPath ("/fpdb/vfe.mdb")&";"
    objConn Open

    DIM mySQL
    mySQL="SELECT * FROM Sheet1 WHERE ID =" & ID

    DIM objRS
    Set objRS=Servier.CreateObject("ADODB.Recordset")
    objRS.Open mySQL, objConn, 1, 3
    %>
     
    50plus, Aug 22, 2008 IP