I am recieving this error message, and the string seems to be right, but I am not sure what to do fix this problem, can someone please help?
I imported Refrence to ADO, and I am running XP. I can't figure this out.
Below is the exact error message:
System.Runtime.InteropServices.COMException (0x80004005): Not a valid file name. at ADODB.ConnectionClass.Open(String ConnectionString, String UserID, String Password, Int32 Options) at WindowsApplication1.Form2.Button3_Click(Object sender, EventArgs e)
My Code Info is:
Dim cnt As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim conStr As String
conStr =
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\store.accdb;"
Dim sqlStr As String = "SELECT Transaction.Date, Transaction.Time, Transaction.Type_Of_Sale, " & _
"Transaction.Total_Products_Bought, Transaction.Total, " & _
"Transaction.Tax FROM Transaction WHERE Transaction.Date=" & Chr(34) & TextBox1.Text & Chr(34)
Try
cnt.Open(conStr)
rst.Open(sqlStr)
Do While Not rst.EOF
I was going to put text here once I could connect to the database file, but I can't even get that far.
rst.MoveNext()
Loop
Catch ex As Exception
#If
DEBUG Then
'Will be compiled into a debug build.
WebBrowser1.DocumentText = ex.ToString()
Exit Sub
#Else
'Will be compiled into a release build.
MessageBox.Show("No Transaction was done that day
")
#End
If
End Try
End Sub
Prior Planning Prevents Piss Poor Performance