Private strConnection As String = _
  "Provider=Microsoft.Jet.OLEDB.4.0; " & _
  "Data Source= C:\Users\KISH\Documents\Visual Studio 2008\Projects\Final Year Project Learning program with HCI\Final Year Project Learning program with HCI\Database2.mdb;Persist Security Info=False"

the porblem i have is if i send this porgam to anthoer computer, the program will not work. how do i re write this code so it can be used on another system.?

Thank for any help

Is your datasource copied to the exact same location on the other computer? As stated in your code. That may be your problem; however without knowing abit more about the error/s its throwing i cannot really think of anything else to suggest.

Hope this helps.

Hi, the code is not same on theother pc. i know there was away to but the file in the root folder so it can be used by others. i need to sudmit my work to my tutor so it can be used on her PC, but i know this code will not work

Sorry i think i didnt explain my last post correctly. i need to code the string above so it can be used on any computer without the user having to change the location, as the porgram will be burnt on to a CD and intsalled on to a computer.

The Connection String you are using is referring to

C:\Users\KISH\Documents\Visual Studio 2008\Projects\Final Year Project Learning program with HCI\Final Year Project Learning program with HCI\Database2.mdb

If the database location on your tutor PC is located on Root , change the path to c:\Database2.mdb , if it is going to be in a directory on the C: drive , change the connection string accordingly ( c:\DirectoryName\Database2.mdb ) , if it is in the same location as the EXE file would be , just use the access file name ( use the relative path )

Thank you i think that make more sence, when u think about it, the soultion is very simple. thank you again.

Hi, I am using visual Studio 2008. How can I add an OleDb connection in my project?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.