Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > System.Runtime.InteropServices.COMException (0x80004005): Not a valid file name
 

System.Runtime.InteropServices.COMException (0x80004005): Not a valid file name

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
Shawn Churchel  Tuesday, August 12, 2008 9:26 PM
Hi Shawn

This is a GAX/GAT related forum, please try to post your question in more specific forum, maybe in the C# forum.
You can look at http://forums.msdn.microsoft.com/en-US/forums/ which is the most applicable forum.

thanks
jose.

Jose Escrich - weblogs.asp.net/jescrich
  • Proposed As Answer byJose Escrich Tuesday, August 12, 2008 9:47 PM
  •  
Jose Escrich  Tuesday, August 12, 2008 9:46 PM

You can use google to search for other answers

Custom Search

More Threads

• Facing problem while working with file system under source control
• Setup missing files.
• Performance for GAX/GAT project
• Unable to load type System.Collections.Generic.Dictionary
• Problem with Specifying Command Bars
• On Package Load Templates Exception?
• Adding a solution to source control during CreateSolution Recipe
• How to make item templates appear in "sub categories" in VS 2008
• installation of extentions fails
• What's the best way to programatically call an action from within another action?