Groups > Databases > Access Databases and AccessDataSource Control > Re: Data Connections - Problems




Data Connections - Problems

Data Connections - Problems
Mon, 17 Mar 2008 20:56:48 +000
Hi I new to ASP.Net and am using Visual Web Developer 2005 and am trying to add
a Data Connection.  I am choosing the data source as: Microsoft Access Database
File (OLE DB) as i need to connect to an Access 2003 database file.  When I
enter the connection string (the path to where the database is stored ex:
~App_Data/test.mdb) and click on test connection it says that it is successful.

However, when i click ok, I get the following error: Format of the
initialization string does not conform to specification starting at index 0.

Even if i leave the connection string empty and just click on ok, I get the
above error.

 

Any Help??  Please
Post Reply
Re: Data Connections - Problems
Tue, 18 Mar 2008 05:33:20 +000
i have created ane prj. on acceess

and set it connection string to 

  <appSettings>
        <add key="DBConn"
value="Provider=Microsoft.Jet.OLEDB.4.0; data
source=\Database\GGNY.mbd"/>
    </appSettings>

in web.config and its working fine
Post Reply
Re: Data Connections - Problems
Tue, 18 Mar 2008 07:38:20 +000
vbnetman:When I enter the connection string (the path to where the database is
stored ex: ~App_Data/test.mdb)

That's not a connection string.  That's a file path.  That would work as the
DataFile property of an AccessDataSource control. Your connection string should
look like this:

Provider=Microsoft.Jet.OleDb.4.0; Data Source=|DataDirectory|test.mdb

In fact, you are better off browsing to the mbd file, and then agreeing to store
the connection string in the web.config, when you are prompted to do so.
Post Reply
Re: Data Connections - Problems
Tue, 18 Mar 2008 19:27:13 +000
Hi Mike.

Unfortunately I do not have the feature to browse off for the mdb file in the
Visual Web Developer Express 2005.  If i put the connection string such as:
Provider=Microsoft.Jet.OleDb.4.0; Data Source=|DataDirectory|test.mdb when im
asked for it would it be fine?
Post Reply
Re: Data Connections - Problems
Tue, 18 Mar 2008 19:34:32 +000
When you configure the SqlDataSource, you should get a screen that says Choose
your Data Connection.  From there, click New Connection, then choose Microsoft
Access Database File.  Then click Continue.  From there, you should get a screen
that has a Browse button next to the Database file name box.
Post Reply
about | contact