locked
trouble in Access database link at web hosting RRS feed

  • Question

  • User1485056329 posted

    hello , i am uploading my ASP web on webhosting panel 

    the project name is test1  ,

    MS access DB name is     db.mdb

    when i went to create the ms access  database on my hosting it asked for these fields 

    DSN name        temp -405

    database useer id   "text box"

    database passwprd   "textbox"

     DBQ (Database Path)  ftproot \db.mdb

    it gave me this

    <form name="form1" method="post" action="http://aljadidrecruit.com.pk:7409/adddsn.html"> ODBC Connection String for this DSN would be :
      "DSN=temp-405;Uid=;Pwd=;"</form><form name="form1" method="post" action="http://aljadidrecruit.com.pk:7409/adddsn.html"></form><form name="form1" method="post" action="http://aljadidrecruit.com.pk:7409/adddsn.html"></form><form name="form1" method="post" action="http://aljadidrecruit.com.pk:7409/adddsn.html"></form><form name="form1" method="post" action="http://aljadidrecruit.com.pk:7409/adddsn.html">now what should i do in next step ?</form><form name="form1" method="post" action="http://aljadidrecruit.com.pk:7409/adddsn.html"></form><form name="form1" method="post" action="http://aljadidrecruit.com.pk:7409/adddsn.html">what should i have to in web.config?</form><form name="form1" method="post" action="http://aljadidrecruit.com.pk:7409/adddsn.html"></form><form name="form1" method="post" action="http://aljadidrecruit.com.pk:7409/adddsn.html">what should i need to do in my grid view  or page code?</form><form name="form1" method="post" action="http://aljadidrecruit.com.pk:7409/adddsn.html"></form><form name="form1" method="post" action="http://aljadidrecruit.com.pk:7409/adddsn.html">
    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AutoGenerateColumns="False" DataKeyNames="jid" DataSourceID="temp-405">
                <Columns>
                    <asp:BoundField DataField="jid" HeaderText="jid" ReadOnly="True" 
                        SortExpression="jid" />
                    <asp:BoundField DataField="job_name" HeaderText="job_name" 
                        SortExpression="job_name" />
                    <asp:BoundField DataField="short_description" HeaderText="short_description" 
                        SortExpression="short_description" />
                    <asp:BoundField DataField="long_description" HeaderText="long_description" 
                        SortExpression="long_description" />
                    <asp:BoundField DataField="quantity" HeaderText="quantity" 
                        SortExpression="quantity" />
                    <asp:BoundField DataField="qualification" HeaderText="qualification" 
                        SortExpression="qualification" />
                </Columns>
            </asp:GridView>
        
            <asp:AccessDataSource ID="temp-405" runat="server" DataFile="~/App_Data/db.mdb" 
                SelectCommand="SELECT * FROM [job]"></asp:AccessDataSource>
        
        </div>
    </form><form name="form1" method="post" action="http://aljadidrecruit.com.pk:7409/adddsn.html">

    </form>
    Tuesday, May 31, 2011 5:37 AM

Answers

All replies

  • User1446927574 posted

    Check following link for your solution.

    http://www.aspfree.com/c/a/Microsoft-Access/Connecting-to-a-Microsoft-Access-database-with-ASPNET/1/

    Let me know if that works.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 1, 2011 12:37 AM
  • User3866881 posted

    Hello:)

    You are now using AccessDataSource to access the db. I think the connectstring the system offered to you does nothing helpful but only to tell you that if you want to connect to MS Access's db with ODBC, you can do with that.

    However You are now using AccessDataSource, and you've deployed the db with your aspx website. So I think no need to configure for your connection string. Because your DataFile="~/App_Data/db.mdb"  has defined where your db locatesm, and the Wizard should do everything for you.

    And futher more, if your db has password, please use this:

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=xxxx;

    For more you can read at:http://www.connectionstrings.com/access

    Wednesday, June 1, 2011 10:13 PM