locked
Connection String RRS feed

  • Question

  • User1173206434 posted

    I have an Access Database with normal tables as well as ODBC tables connected to Sybase 11. When I create a connection string to the Access Database and display a SQL statement in a gridview, I am prompted for the Sybase logon every time I sort the data or change to say page 2.

    Is there a way to create a connection string that gives me access to the Access DB tables and will not prompt me for the Sybase logon info every time?

    Here is my current connection string:

    <connectionStrings>

    <add name="YardPlanning_BEConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\DSO\Projects\Staff Planning\App_Data\YardPlanning_BE.mdb;"

    providerName="System.Data.OleDb" />

    </connectionStrings>

     Thanks!

    Wednesday, May 20, 2009 8:43 AM

Answers

  • User-925286913 posted

    Refer to: http://www.connectionstrings.com/access#21 

    Change connectionstring section as:

     <connectionStrings>

    <add name="YardPlanning_BEConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\DSO\Projects\Staff Planning\App_Data\YardPlanning_BE.mdb;Uid=USERID;Pwd=;PASSWORD"

    providerName="System.Data.OleDb" />

    </connectionStrings>

    Ideally this connectionstring should be written as:

     <connectionStrings>

    <add name="YardPlanning_BEConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDictionary|\YardPlanning_BE.mdb;Uid=USERID;Pwd=;PASSWORD"

    providerName="System.Data.OleDb" />

    </connectionStrings>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 20, 2009 9:21 AM
  • User-1199946673 posted

    You're pointing to the right webpage, but to the wrong bookmark (ODBC instead of OleDb), The correct link is:

    http://www.connectionstrings.com/access#20

    The correct syntax is:  

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDictionary|\YardPlanning_BE.mdb;User Id=USERID;Password=PASSWORD;"

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 20, 2009 5:52 PM

All replies

  • User-925286913 posted

    Refer to: http://www.connectionstrings.com/access#21 

    Change connectionstring section as:

     <connectionStrings>

    <add name="YardPlanning_BEConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\DSO\Projects\Staff Planning\App_Data\YardPlanning_BE.mdb;Uid=USERID;Pwd=;PASSWORD"

    providerName="System.Data.OleDb" />

    </connectionStrings>

    Ideally this connectionstring should be written as:

     <connectionStrings>

    <add name="YardPlanning_BEConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDictionary|\YardPlanning_BE.mdb;Uid=USERID;Pwd=;PASSWORD"

    providerName="System.Data.OleDb" />

    </connectionStrings>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 20, 2009 9:21 AM
  • User1173206434 posted

    Thanks for your prompt reply. However, I had tried this before and it does not work. I get the following error:

    Server Error in '/Staff Planning' Application.

    Could not find installable ISAM.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.OleDb.OleDbException: Could not find installable ISAM.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [OleDbException (0x80004005): Could not find installable ISAM.]
       System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +281
       System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +124
       System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +91
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +115
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +122
       System.Data.OleDb.OleDbConnection.Open() +49
       System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +49
       System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +162
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +307
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +152
       System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +2868
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +84
       System.Web.UI.WebControls.DataBoundControl.PerformSelect() +154
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +99
       System.Web.UI.WebControls.GridView.DataBind() +24
       System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +91
       System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +101
       System.Web.UI.Control.EnsureChildControls() +134
       System.Web.UI.Control.PreRenderRecursiveInternal() +109
       System.Web.UI.Control.PreRenderRecursiveInternal() +233
       System.Web.UI.Control.PreRenderRecursiveInternal() +233
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4435
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 <!-- [OleDbException]: Could not find installable ISAM. at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.OleDb.OleDbConnection.Open() at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at System.Web.UI.WebControls.GridView.DataBind() at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.updates_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->

    Wednesday, May 20, 2009 10:54 AM
  • User-1199946673 posted

    You're pointing to the right webpage, but to the wrong bookmark (ODBC instead of OleDb), The correct link is:

    http://www.connectionstrings.com/access#20

    The correct syntax is:  

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDictionary|\YardPlanning_BE.mdb;User Id=USERID;Password=PASSWORD;"

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 20, 2009 5:52 PM