Solved

Connecting to a databse

Posted on 2008-10-12
3
333 Views
Last Modified: 2012-05-05
Hi, i,m trying to connect to a database in a server. i can connect using local host but when i try to connect it to the database in the server it gie an error

this is the code that i,m using to tel that the database is in the server

Dim dataPath As String = Server.MapPath("dato.mdb")
        Me.AccessDataSource1.ConnectionString = Me.AccessDataSource1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & dataPath

but it tel me that the conectionstring can,t be change manualy
i,m using visual web developmet 2005 with visual basic language
0
Comment
Question by:cano63
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Expert Comment

by:ajolly
ID: 22699943
what is the error message ?
0
 
LVL 1

Author Comment

by:cano63
ID: 22706349
System.InvalidOperationException was unhandled by user code
  Message="The AccessDataSource ConnectionString property cannot be set, it is automatically generated."

that's the error
 
0
 
LVL 7

Accepted Solution

by:
ajolly earned 125 total points
ID: 22708334
yes, connection string for AccessDataSource is a read only property.
You need to specify in design time.

You can set DataFile property and it will generate the connection string which you can only read.

Setting only the DataFile will work for you.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month7 days, 5 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question