Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Several sql queries with the same recordset fbonnard Excel Programming 2 November 2nd 04 05:50 PM
0 with ADODB Recordset Stefen Percoco Excel Programming 1 July 8th 04 09:54 PM
Type recordset/recordset? FlaviusFlav[_9_] Excel Programming 4 May 24th 04 12:16 PM
Recordset Stephan Kassanke Excel Programming 0 September 10th 03 04:45 PM
Looping Through A Recordset Bob Phillips[_5_] Excel Programming 0 August 19th 03 03:34 PM


All times are GMT +1. The time now is 09:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"