Several sql queries with the same recordset

  • Thread starter Thread starter fbonnard
  • Start date Start date
F

fbonnard

When you said

set Cnn=New ADODB.Connection
Cnn.Open Cn
Cnn.Execute sql ' your SQLS starting UPDATE (does not return a recor
set)
Cnn.Execute sql ' your SQLS starting INSERT (does not return a recor
set)


What is cn ?

How can i use RecordCount and CopyFromRecordset if i need to make
select
 
Refer to the Excel VBA help file for information on CopyFomRecordSet.
 
Refer to the code in your original query .... relevant part pasted here (see
line 2):

If (Range("B" & i).Value > 0) Then
rs.Open mySql4, cn, adOpenStatic
rs.Close
Else
rs.NextRecordset mySql3, cn, adOpenStatic
rs.Close
End If

cn in this context is either an ADODB.Connection object that has been opened
or it is simply a string that can be used to connect to the databas,
something like:

cn="DSN=your DSN;UID=your userid;PWD=your password"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top