S
SlowGirl
I am trying to pass three values from an access form to a where statement in
a SQL Stored Procedure. I'm new at this; what am I doing wrong? Also, is
there a way to write the connection string so it prompts users for their own
username/password? The pasted code in on the AfterUpdate event of a text
box. Thanks in advance
------------------
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
cmd.ActiveConnection = "PROVIDER=SQLOLEDB;Data Source=MyServer;Initial
Catalog=MyDb;User Id=user;Password=pword"
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "spUpdateList"
Dim strEID As String
Dim strFieldName As String
Dim strNewValue As String
strFieldName = "Title"
strEID = Trim(Me.txtEID.Value)
strNewValue = Me.txtTitleUpdate.Value
cmd.Execute , Array(strEID, strFieldName, strNewValue)
a SQL Stored Procedure. I'm new at this; what am I doing wrong? Also, is
there a way to write the connection string so it prompts users for their own
username/password? The pasted code in on the AfterUpdate event of a text
box. Thanks in advance
------------------
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
cmd.ActiveConnection = "PROVIDER=SQLOLEDB;Data Source=MyServer;Initial
Catalog=MyDb;User Id=user;Password=pword"
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "spUpdateList"
Dim strEID As String
Dim strFieldName As String
Dim strNewValue As String
strFieldName = "Title"
strEID = Trim(Me.txtEID.Value)
strNewValue = Me.txtTitleUpdate.Value
cmd.Execute , Array(strEID, strFieldName, strNewValue)