Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai friends,

I have connected database in my form

This the actual path of the database

VB
D:\RESOLVED\TSMS_1.0\DB.accdb


and i mention the database like this

VB
con = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=DB.accdb")

The actual problem is when i update the database from the form, it creates a another access file(DB.accdb) in the bin folder.

when i restart the form the updation or not shown.

I need to update single database.
Someone advice me to use like this
VB
con = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source= Application.StartupPath &"\" &youraccessfile name;Persist Security Info=True")

Still am having error on this line.

Error: Conversion from string "Provider=Microsoft.ACE.OLEDB.12." to type 'Long' is not valid.


Please help me in this issue.
Posted
Updated 26-Feb-14 3:40am
v2
Comments
Richard MacCutchan 26-Feb-14 9:39am    
Look at your access string, there may be a quote missing somewhere. Show the actual code in your program and the exact error message and the line where it occurs.
Sissy Ram 26-Feb-14 10:30am    
No i resolved it myself.
The problem still occurs while i am using database file format as "accdb".
So i convert 'accdb' to 'mbd'
and used,

Dim con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\DB.mdb")

Now it works fine.
Thank you for all your supports friends.

1 solution

The problem still occurs while i am using database file format as "accdb".
So i convert 'accdb' to 'mbd'
and used,

VB
Dim con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\DB.mdb")

Now it works fine.
Thank you for all your supports friends.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900