O
osupratt via AccessMonster.com
I have DSN Less connection code as follows for linked tables which the code
is on the switchboard form:
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.
' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True
Dim ServerName As String
Dim UserName As String
Dim Password As String
ServerName = "CPSHOUDB15"
UserName = "********"
Password = "********"
'Attach the linked database tables if they aren't already attached
AttachDSNLessTable "dbo_MAS_MWS_AR1_CustomerMaster",
"MAS_MWS_AR1_CustomerMaster", ServerName, "MAS_TXD_IMPORT", UserName,
Password
'If CreateDSNConnection("(local)", "pubs", "", "") Then
'// All is okay.
'Else
'// Not okay.
'End If
End Sub
How would I use something like this for a Pass Through query? And where or
what form would this be placed? I have a check box on a main data entry form
that runs the pass through query. I just need help with the connection
staying connected. Any help would be appreciated. Thanks.
is on the switchboard form:
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.
' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True
Dim ServerName As String
Dim UserName As String
Dim Password As String
ServerName = "CPSHOUDB15"
UserName = "********"
Password = "********"
'Attach the linked database tables if they aren't already attached
AttachDSNLessTable "dbo_MAS_MWS_AR1_CustomerMaster",
"MAS_MWS_AR1_CustomerMaster", ServerName, "MAS_TXD_IMPORT", UserName,
Password
'If CreateDSNConnection("(local)", "pubs", "", "") Then
'// All is okay.
'Else
'// Not okay.
'End If
End Sub
How would I use something like this for a Pass Through query? And where or
what form would this be placed? I have a check box on a main data entry form
that runs the pass through query. I just need help with the connection
staying connected. Any help would be appreciated. Thanks.