how can i use a system dsn in access VBA?
i want to call a stored procedure 'sp_InsertText'
and i have a system dsn 'sys_Data'
what code do i need to call this stored procedure in access?
Printable View
how can i use a system dsn in access VBA?
i want to call a stored procedure 'sp_InsertText'
and i have a system dsn 'sys_Data'
what code do i need to call this stored procedure in access?
From within Access you can use DAO (or add a reference to ADO)
With DAO you can use ODBCDirect to access.
VBA Code
VB Code:
Dim db As DAO.Database Dim ws As DAO.Workspace Set ws = DBEngine.CreateWorkspace("", "", "", dbUseODBC) Set db = ws.OpenConnection("", , , "ODBC;DSN=sys_Data;uid=UserNameHere;pwd=PasswordHere;") db.Execute "{ call sp_InsertText}"