jadams0173
Technical User
- Feb 18, 2005
- 1,210
Using SQL server 2000 and Access 2000.
I've read and am still unable to update my form. Can anyone offer an suggestions.
And in my form load. I have also tried form open.
I've read and am still unable to update my form. Can anyone offer an suggestions.
Code:
Function OpenConnection()
Dim constr As String
'Dim conn As ADODB.Connection
On Error GoTo ERROR_HANDLER_CON
'Set conn = New ADODB.Connection
If conn Is Nothing Then
Set conn = New ADODB.Connection
End If
'*******************
With conn
.Provider = "MSDataShape"
'The code below uses a sample server name, user ID, and password.
'Be sure to use your actual server name, user ID, and password.
.ConnectionString = "DATA PROVIDER=SQLOLEDB;DATA " _
& "SOURCE=STAT1;Initial Catalog=SCHED;Trusted_Connection=Yes"
.CursorLocation = adUseServer
.Open
End With
Exit Function
And in my form load. I have also tried form open.
Code:
Dim rsTemp As ADODB.Recordset
Set rsTemp = New ADODB.Recordset
With New ADODB.Command
.ActiveConnection = conn
.CommandText = "USP_TempRS"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@USERNAME", adChar, , 8, Environ("USERNAME"))
Set rsTemp = .Execute
End With
Set Me.Recordset = rsTemp
'conn.Close
Forms!FRMMAIN_SQL.Visible = True
DoCmd.Maximize
End Sub