How to open the local database from my website

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Elavarasi
    New Member
    • Oct 2007
    • 11

    How to open the local database from my website

    My database (ms access) is in ftp;
    i want to transfer the one particular table content to local db which is in my system...

    the coding i written was



    ' for local database connection
    <%
    strconnect="Pro vider=Microsoft .Jet.OLEDB.4.0; Data Source=" & strpath & " ; Persist Security Info=False"

    set Conloc = Server.CreateOb ject("ADODB.Con nection")
    Conloc.Provider ="Microsoft.Jet .OLEDB.4.0"
    Conloc.Open strconnect
    strdelete="Dele te * from tablename"
    Conloc.execute( strdelete)

    ' Ftp database connection

    call opendatabase()
    Set rsftp= con.Execute("se lect * from tableftp")

    While not rsftp.Eof
    ms=rsftp.fields ("msg")
    ss=rsftp.fields ("sender")
    Response.Write( "Message::" & msg)
    Response.Write( "Sender :: " & sender)
    ' str_insert="Ins ert Into tableftp(ss,ms) values( '" & ss & " ','" & ms & "')"
    Conloc.Execute str_insert
    rsftp.movenext
    wend

    call closedatabase()


    End if




    %>






    <form name="frm1">
    <center>
    <label for="uploadfile "><b>File name:</b> </label>
    <input type="file" name="uploadfil e" id="uploadfile" >
    <br><br><br>
    <button name="btnsubmit " style="backgrou nd-color:#E0DAB8" onclick="btnfil e()" value="Send"><b >Update the Database </b> </button>
    <input type="hidden" name="txthid">
    </center>
    </form>


    when i try to open i got http 505 error ..page cant be viewed,,,
    please help..
  • JamieHowarth0
    Recognized Expert Contributor
    • May 2007
    • 537

    #2
    Hi Elavarasi,

    Can you please explain further what you are trying to do?

    I think I have the main jist of what you require but I'm not precisely sure.

    If I'm right, you're trying to update a database using a file upload (where you use SQL to delete the old data, and then use SQL on the uploaded file to insert new data into your remote database)?

    Let me know if this is what you mean and we'll try our best to help you further.

    Best regards,

    medicineworker

    Comment

    • Elavarasi
      New Member
      • Oct 2007
      • 11

      #3
      Hi

      i want to access the database which is at local machine....
      (for eg:: c:...\desktp\dd .mdb) from web page.Is it possible to access that database (the database in ms access)

      Silimal to backup.. instead of transfering entire database.. i want to transfer a single table... to my local database.. ( its for single user.. ) not for all...

      regards
      ela..




      Originally posted by medicineworker
      Hi Elavarasi,

      Can you please explain further what you are trying to do?

      I think I have the main jist of what you require but I'm not precisely sure.

      If I'm right, you're trying to update a database using a file upload (where you use SQL to delete the old data, and then use SQL on the uploaded file to insert new data into your remote database)?

      Let me know if this is what you mean and we'll try our best to help you further.

      Best regards,

      medicineworker

      Comment

      • JamieHowarth0
        Recognized Expert Contributor
        • May 2007
        • 537

        #4
        Hi Elavarasi,

        I don't think that ASP is able to connect to a database stored on your machine as it would have to get your IP details and use an ODBC connection along with sharing your Access database in a folder that is viewable across the Net.

        However, you are able to upload files to web servers using ASP, so my suggestion would be to use a file upload script, such as the one described in this article and then dynamically determine the location of that uploaded MDB, retrieve the table you require and then use SQL to store the information using INSERT INTO into your new database.

        Hope that helps.

        medicineworker

        Comment

        Working...