Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Connecting to an Access mdb web.config

Reply
Thread Tools

Connecting to an Access mdb web.config

 
 
msch-prv@bluewin.ch
Guest
Posts: n/a
 
      07-19-2006
I have difficulties declaring and using an Access connection string.
The web.config declaration is:

<connectionStrings>
<add name="DbConn"
connectionString="~/App_Data/CRM2K_be.mdb"
providerName="System.Data.OleDb"/>
</connectionStrings>

In the Page_Load event, I have the following:

Dim sqlSrc As SqlDataSource
sqlSrc = New
SqlDataSource(ConfigurationManager.ConnectionStrin gs("DbConn").ConnectionString,
"SELECT CustLName FROM tblCust")
grd2.DataSource = sqlSrc
grd2.DataBind()

When I run the page, an initialization error pops up: 'Format of the
initialization string does not conform to specification starting at
index 0'

What is the proper syntax (ASP.NET 2.0)? Are there some Access sample
apps to demonstrate these pinciples? Most of the samples rely on SQL
Express.

(Side comment: As a newbie, I find ASP.NET 2.0 really tough to get a
hang on. The MS literature is overwhelming, but not really useful if
you are learning the basics.)

TIA, Mark

 
Reply With Quote
 
 
 
 
msch-prv@bluewin.ch
Guest
Posts: n/a
 
      07-19-2006
Sorry, I found the answer to my question. By mistake, I used a
SqlDataSource object instead of AccessDataSource.

Substituting back makes it work ie:
sqlSrcAcc = New
AccessDataSource(ConfigurationManager.ConnectionSt rings("DbConn").ConnectionString,
"SELECT CustLName FROM tblCust")

Question: Instead of using explicit SQL statements, would it be
possible to import Access queries into the sqlSrcAcc object?

TIA, Mark

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MDB to MDB Event Notification John Schult Java 0 05-04-2005 01:26 AM
Faster access to MDB? MS Access MDB and ASP =?Utf-8?B?UGhpbA==?= ASP .Net 8 01-27-2005 07:08 PM
Bizzare: Invalid path to Access mdb, path is good Keith-Earl ASP .Net 1 05-03-2004 03:25 PM
Could not display a column in Access 2000 nwind.mdb in a listbox using ole DataAdapter, Connection and dataset controls yma ASP .Net 1 12-16-2003 06:20 PM
Matrix generated Access mdb Update function not working Dave ASP .Net 1 09-10-2003 07:55 AM



Advertisments