Solved

Connecting to a databse

Posted on 2008-10-12
3
323 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
  • 2
3 Comments
 
LVL 7

Expert Comment

by:ajolly
Comment Utility
what is the error message ?
0
 
LVL 1

Author Comment

by:cano63
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now