Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Several sql queries with the same recordset
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 -- fbonnar ----------------------------------------------------------------------- fbonnard's Profile: http://www.excelforum.com/member.php...fo&userid=1597 View this thread: http://www.excelforum.com/showthread.php?threadid=27446 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Several sql queries with the same recordset
Refer to the Excel VBA help file for information on CopyFomRecordSet.
"fbonnard" wrote: When you said set Cnn=New ADODB.Connection Cnn.Open Cn Cnn.Execute sql ' your SQLS starting UPDATE (does not return a record set) Cnn.Execute sql ' your SQLS starting INSERT (does not return a record set) What is cn ? How can i use RecordCount and CopyFromRecordset if i need to make a select ? -- fbonnard ------------------------------------------------------------------------ fbonnard's Profile: http://www.excelforum.com/member.php...o&userid=15977 View this thread: http://www.excelforum.com/showthread...hreadid=274467 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Several sql queries with the same recordset
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" "fbonnard" wrote: When you said set Cnn=New ADODB.Connection Cnn.Open Cn Cnn.Execute sql ' your SQLS starting UPDATE (does not return a record set) Cnn.Execute sql ' your SQLS starting INSERT (does not return a record set) What is cn ? How can i use RecordCount and CopyFromRecordset if i need to make a select ? -- fbonnard ------------------------------------------------------------------------ fbonnard's Profile: http://www.excelforum.com/member.php...o&userid=15977 View this thread: http://www.excelforum.com/showthread...hreadid=274467 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Several sql queries with the same recordset | Excel Programming | |||
0 with ADODB Recordset | Excel Programming | |||
Type recordset/recordset? | Excel Programming | |||
Recordset | Excel Programming | |||
Looping Through A Recordset | Excel Programming |