Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Dim con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\billing.accdb;Persist Security Info=True")
        Dim objcmd As OleDbCommand
        con.Open()
        objcmd = New OleDbCommand("INSERT INTO bills VALUES(..,.. ,.....)", con)
        objcmd.ExecuteNonQuery() <------------ Getting Error here that the path is not correct
        con.Close()
Posted
Updated 16-Nov-11 18:16pm
v2
Comments
Wayne Gaylard 17-Nov-11 1:51am    
Can you post the exact error you recieve. Please modify your original question using Improve question and don't post it as an answer.

1 solution

I would say the error message says it all. Have you put a breakpoint in the method and checked whether the connection string is indeed correct ? Have you physically checked that the database is indeed in the directory identified in the connection string ? You need to give more details on what you have done.
 
Share this answer
 
Comments
Manoj K Bhoir 17-Nov-11 0:36am    
Best Answer!
Wayne Gaylard 17-Nov-11 1:49am    
from OP - yes select command is working properly but at the time insert command only error comes,.... and i have checked the database path physically its perfectly correct

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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