Connection String Help

  • Thread starter Thread starter Charles A. Lackman
  • Start date Start date
C

Charles A. Lackman

Hello I am trying to connect to a liked table.

When I run this query a window pops up that wants a User Name and Password:
No User Name and Password is Required - If I click ok (without credentials)
the query runs fine. The problem is that I am trying to send the
credentials in my connection string so that the window doesn't pop up. I am
running a simple query (similar to this) in a Windows Service - so no window
pops up but nothing is returned.


Dim ADataAdapter As OleDb.OleDbDataAdapter
Dim AConnection As New
OleDb.OleDbConnection("Provider=Microsoft.jet.OLEDB.4.0;Data Source=" &
Me.DatabaseLocation & ";User Id= ; Password= ;")

ADataAdapter = New OleDb.OleDbDataAdapter("SELECT * FROM Table1,
AConnection)

AConnection.Open()
ADataAdapter.Fill(ADataSet, "Temp")
AConnection.Close()

I have experimented with multiple ways of getting this work with no success:

Dim AConnection As New
OleDb.OleDbConnection("Provider=Microsoft.jet.OLEDB.4.0;Data Source=" &
Me.DatabaseLocation & ";User Id= ''; Password= '';")

AND

Dim AConnection As New
OleDb.OleDbConnection("Provider=Microsoft.jet.OLEDB.4.0;Data Source=" &
Me.DatabaseLocation & ";User Id=admin ; Password= 1111;")

If I put "admin" in the UserName and "1111" in the password pop up box, it
lets me in - however, it does not work in the connection string: I receive
a workgroup logon error.

Any assistance will be greatly appreciated,

Thanks,
Chuck
 
Back
Top