COM Exception was unhandled, Invalid authorization specification.

NJDubois

Well-known member
Joined
May 15, 2008
Messages
84
Programming Experience
Beginner
In the following bunch of code, I get an Invalid Authorization Specification Error. I find search results with that error, but never anything related to what I am doing =(

VB.NET:
Dim SQL_Conn_Obj As New ADODB.Connection
Dim RecSet As New ADODB.Recordset

Dim filename As String = Application.StartupPath & "\Mar.sdf"

Dim SQL_Conn_Str As String = _
"Provider = sqloledb;" & _
"Data Source=" & filename & ";" & _
"Initial Catalog=Mar.sdf;" & _
"User ID=;" & "Password=;"

SQL_Conn_Obj.Open(SQL_Conn_Str) ' INVALID AUTHORIZATION SPECIFICATION ERROR HERE!

RecSet.Open("select * from Call_Records", SQL_Conn_Obj,

I have not set a password inside mar.sdf. It should be left blank right?
I am using Visual Studios express 08 to build the database and I have not found
a place to enter a user name?

What am I missing here?
Many thanks
Nick
 
You seem to be a tad confused about what database you're using. You have posted this thread in the MySQL forum but you are not using MySQL. You are using the OLE DB provider but you are not using SQL Server. You are using an SDF file, which is a SQL Server CE (Compact Edition) database. Also, if you're using VB.NET then why aren't you using ADO.NET?

First things first, if you haven't already, install SQL Server CE. Next, add a reference to the SQL Server CE data access library to your project. Now you have access to the SQL Server CE-specific ADO.NET provider. Now, you can create a SqlCeConnection and a SqlCeDataAdapter and populate a DataTable with your data.
 
Back
Top