ConnectionString

  • Thread starter Thread starter Becks
  • Start date Start date
B

Becks

Hey people, sorry for the cross post but both groups have dealt with this
problem in the past.

I have an unbound ADP that I want to connect and disconnect to using code. I
found some stuff from Mary Chipman that talked about creating a new ADP and
creating Cancel at the Data Link prompt and creating your own login form
that runs from startup.

I did this but once the first connection has completed, you are then
prompted by Access with its own login box before opening the custom one.
I am closing the currentproject.connection when a hidden form is unloaded
but this is not enough.
I am wondering whether something in my connection string is causing this or
maybe it is Access itself (XP).

strConnection = "Provider=Microsoft.Access.OLEDB.10.0;Persist Security
Info=False;Data Source=OTUSLONS2;User ID=becks;Initial Catalog=USAF;Data
Provider=SQLOLEDB.1"

I have done everything I can think of and this is now causing a serious
problem,
Please help !

Thanks
Becks
 
hi



Private Sub Form_Open(Cancel As Integer)
Application.CurrentProject.OpenConnection _
"Provider=SQLOLEDB.1;" _
+ "Persist Security Info=false;" _
+ "Initial Catalog=YOUPDATABASE;" _
+ "Data Source=YOURSERVER;" _
+ "UID=login;" _
+ "PWD=password;"
End Sub

Private Sub Form_Unload(Cancel As Integer)
Application.CurrentProject.OpenConnection "" '--important
End Sub

thats all :-)
 
Suddenly realised I hadn't thanked you for helping out with this. It works
like a dream although I am getting delays in views showing all columns in a
table when the table has had a new column added,
Any ideas?

Thanks again,
Becks
 
Back
Top