I have an Access database that I upsized with the wizard wishing to continue using Access for the Front End. I want to be able to connect to the SQL database without having each computer setup for the DSN. I added this to the autoexec macro.
Function autoexec()
On Error GoTo autoexec_Err
**oConn.Open "ODBC;Driver={SQL Server};" "Server=xxxxMSQL01;" "Database=Sublist;" "Trusted_Connection=yes"**
DoCmd.OpenForm "FSublistc", acNormal, "", "", , acNormal
DoCmd.Maximize
autoexec_Exit:
Exit Function
autoexec_Err:
MsgBox Error$
Resume autoexec_Exit
End Function
The error I get is ODBC-Connection failed.
For my testing I did create a DSN on this computer with this user that worked fine. Then when I removed the DSN connection and ran the database I for the ODBC-Connection failed.
Any ideas?
Thanks.