connecting to database without hardcoding

Results 1 to 2 of 2

Thread: connecting to database without hardcoding

  1. #1
    Join Date
    Dec 1969

    Default connecting to database without hardcoding

    Hello.<BR>It is more than a month that I couldn&#039;t solve this problem.somebody told me:<BR><BR>"If the db is in the root directory of your website then <BR>Source=Server.MapPath("Directors.mdb") <BR>But you will need read/write permissions on the root directory if you are going to be doing inserts and deletes from the DB"<BR><BR><BR>Source=Server.MapPath(" b") This doen&#039;t work,is there any syntax error?<BR>In the following lines you see the strconnect,the source of that is arranged according to address of my hard,then it doesn&#039;t work when you upload it to Internet.Could you change the line in a way that I can upload it to Internet:<BR>(look at line 4 & 5)My questions are at the bottom of the page.Rewrite it by Server.mappath() I don&#039;t know how.<BR><BR>&#060;html&#062;<BR>&#060;body&#062;<B R>&#060;%<BR>strconnect="provider=microsoft.jet.ol edb.4.0;data source=C:InetpubwwwrootDirectors.mdb"<BR>set objcon=server.createobject("ADODB.Connection")<BR> set objrs=server.createobject("ADODB.recordset")<BR>ob strconnect<BR> "Directors1" , objcon<BR>While not objrs.EOF<BR>Response.write objrs("SerialNo") & " "<BR>Response.write objrs("DirectorName") & " "<BR>Response.write objrs("FilmName") & " "<BR>Response.write objrs("ActorName") & " "<BR>Response.write objrs("ActoressName") & " "<BR>Response.write objrs("DateOfProduction") & " "<BR>Response.write objrs("DateOfDisply") & " "<BR>Response.write objrs("Budget") & "<BR>"<BR>objrs.movenext<BR>wend<BR>objrs.close<BR >objcon.close<BR>set objrs=nothing<BR>set objcon=nothing<BR>%&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><BR>1.Now re-write this line in a way that I can upload it to Internet:<BR>strconnect="provider=microsoft.jet.ol edb.4.0;data source=C:InetpubwwwrootDirectors.mdb"<BR><BR><BR>B est Regards<BR>Reza Saheban <BR>

  2. #2
    Join Date
    Dec 1969
    Indianapolis, IN

    Default CROSSPOST <eop>


Posting Permissions

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