Bryant,
 
The ADO command object would be used in code, something like this:
 
Dim cmd As ADODB.Command
Dim conn As ADODB.Connection
Dim strSQL As String
 
Set conn = Application.CurrentProject.Connection
Set cmd = New ADODB.Command
 
strSQL = "UPDATE tblSomeTable SET SomeField='SomeValue' WHERE SomeOtherField=12099"
 
With cmd
    .ActiveConnection = conn
     .CommandType = adCmdText
     .CommandText = strSQL
    .Execute
End With
 
 
You can completely bypass your saved query if you want.  If you need to pass a parameter, you can create a routine that takes the parameter, builds your SQL string, and fires it via the command object. 
 

Tom Oakes
Personal PC Consultants, Inc.
[EMAIL PROTECTED]
503.230.0911 (O)
402.968.6946 (C)
713.583.7091 (F)


   


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Bryant
Sent: Wednesday, July 13, 2005 10:11 PM
To: [email protected]
Subject: [AccessDevelopers] ADO parameters for action query

I'm having problems working with parameters for action queries, using
an ADO command object.

All the examples seem to display the ways of creating a recordset --
but I don't wish to return rows, only to insert or update records,
based on parameters being passed to a saved Access query.

Could you please point me towards some examples?

Thanks in advance,
Bryant






Please zip all files prior to uploading to Files section.





Please zip all files prior to uploading to Files section.




YAHOO! GROUPS LINKS




Reply via email to