473,511 Members | 15,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connecting to an Access mdb web.config

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

Jul 19 '06 #1
1 3054
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

Jul 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2042
by: maddunr | last post by:
Hi, I just installed PHP 4.3.9, MySQL 4.0.2 and PHPMyAdmin 2.6.0-pl3 on our intranet server (Win2k3 running IIS). I also have a similar setup on my local machine (http://localhost/phpmyadmin). ...
11
2364
by: Patrick | last post by:
I have an ASP.NET application that connects to a SQL Server database. The SQL Server resides on a seperate development server from the IIS5.1 on Windows XP SP2 on development PCs which host the...
12
2753
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
2
1728
by: josef | last post by:
This seems like a bad idea, but I'm having trouble identifying why. With an ASP.NET application I am using Windows Integrated Authentication. The aspnet_wp.exe runs as 'machine' per the...
7
1763
by: Greg W via DotNetMonster.com | last post by:
hello all, I have site that I just moved to a new host. It is a dedicated server that sits behind a dedicated firewall. Most of the site uses classic ASP that are working fine but I have some...
6
7760
by: Todd Brewer | last post by:
Windows Server 2000 ASP.NET 2.0 SQL Server 2000 (on a physically seperate server) I moved an ASP.NET 2.0 application from a development server to production, and am getting the following error:...
2
4107
by: Patrick F | last post by:
Hi, i have SQL Server 2005 and a database set that is called, myCompany the problem is that i cant connect from my page to it, here is from the web.config: ( i have got this connectionstring from...
0
3868
by: Abhi | last post by:
Hi, I have to connect to Oracle 10g Database using Data Access Application block code i am using is Connection string is contained in a file called orcle.config and it contains ...
2
1128
by: Michael Howes | last post by:
I am trying to upgrade a large asp.net application from .Net 1.1 to ..Net 3.0 I'm getting an error when connecting to the database now that the app runs as a .Net 3.0 application. the...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.