Click here to Skip to main content
15,889,877 members
Home / Discussions / Database
   

Database

 
AnswerRe: Select with a select Pin
DiWa1-Nov-05 18:03
DiWa1-Nov-05 18:03 
GeneralRe: Select with a select Pin
j1webb2-Nov-05 3:05
j1webb2-Nov-05 3:05 
QuestionWhat is in SQL Server 2005 Developer Edition Pin
Paul Watson31-Oct-05 22:10
sitebuilderPaul Watson31-Oct-05 22:10 
AnswerRe: What is in SQL Server 2005 Developer Edition Pin
Colin Angus Mackay31-Oct-05 22:44
Colin Angus Mackay31-Oct-05 22:44 
AnswerRe: What is in SQL Server 2005 Developer Edition Pin
Mike Dimmick1-Nov-05 1:50
Mike Dimmick1-Nov-05 1:50 
Questioncall store procedure using C++ code Pin
qdo999931-Oct-05 15:12
qdo999931-Oct-05 15:12 
Question1000 ADO problems... Pin
l3st4rd31-Oct-05 7:55
l3st4rd31-Oct-05 7:55 
AnswerRe: 1000 ADO problems... Pin
jonathan151-Nov-05 23:35
jonathan151-Nov-05 23:35 
I cant answer all your questions but i can give you a few ideas.

1. Yes this is correct. ADO recordcount is not like it was in the older DAO. It basically returns the recordcount to the current cursor location so yes you need to call recordset.movelast before you can get a count. It should work for you like this.

Just as a side issue which may help i prefer to set all the recordset properties before opening the recordset. Its more readable eg

set rs = new recordset
rs.cursorlocation = adUseCLient
rs.cursortype = adOpenDynamic
rs.locktype = adLockOptimistic
rs.open sql,connection

2 & 6. try to look at it logically. Define a string variable to hold the SQL eg
dim sSQL as string
sSQL = "SELECT * FROM " & TableName & " WHERE ID = " & CStr(id)
rs.open ssql,connection

you can then set a breakpoint and see what the sql actually contains. Also i would probably set the recordset to a new recordset then set it to nothing within the loop since you are actually creating a new recordset.

3. Do you have any code in the errorhandler to report the Error? What is the error? It could be more of a structure problem if it works without the error handling.

4. OK. You seem to be a bit confused about the use of batch uptates etc.
I am pretty sure you need a client side cursor to use the batch updates. If you use updatebatch you need to use adlockbatchoptimistic as the lock type. I suggest you find some examples on the web but in general the flow should be.

set rs = new recordset
rs.cursorlocation = adUseCLient
rs.cursortype = adOpenDynamic
rs.locktype = adLockBatchOptimistic
rs.open sql,connection

for i = 0 to 9
rs.add
rs.fields(0) = Value
rs.fields(1) = value
next

rs.marshaloptions = admarshallall ' or admarshallmodifiedonly
rs.updatebatch

5. None specific to using SQL unless you have joins

Its been a while since i used ADO but i hope i have given you some ideas.

Jon
QuestionSending Http Post Request from Stored Procedure Pin
vineet1378031-Oct-05 7:24
vineet1378031-Oct-05 7:24 
QuestionHelp! our DBA died Pin
sameerhanda31-Oct-05 5:12
sameerhanda31-Oct-05 5:12 
AnswerRe: Help! our DBA died Pin
Mike Dimmick1-Nov-05 1:59
Mike Dimmick1-Nov-05 1:59 
GeneralRe: Help! our DBA died Pin
sameerhanda2-Nov-05 3:35
sameerhanda2-Nov-05 3:35 
GeneralRe: Help! our DBA died Pin
rwestgraham2-Nov-05 11:34
rwestgraham2-Nov-05 11:34 
GeneralRe: Help! our DBA died Pin
sameerhanda3-Nov-05 4:24
sameerhanda3-Nov-05 4:24 
QuestionXML to SQL Server data transformation Pin
Probal Roy31-Oct-05 2:12
Probal Roy31-Oct-05 2:12 
QuestionSQL - Check if field contains string Pin
Zanathel30-Oct-05 7:07
Zanathel30-Oct-05 7:07 
AnswerRe: SQL - Check if field contains string Pin
toxcct30-Oct-05 8:12
toxcct30-Oct-05 8:12 
GeneralRe: SQL - Check if field contains string Pin
Zanathel30-Oct-05 11:15
Zanathel30-Oct-05 11:15 
GeneralRe: SQL - Check if field contains string Pin
toxcct30-Oct-05 20:58
toxcct30-Oct-05 20:58 
GeneralRe: SQL - Check if field contains string Pin
Leather992-Nov-05 3:30
Leather992-Nov-05 3:30 
QuestionmySql in my application Pin
Sasuko29-Oct-05 14:01
Sasuko29-Oct-05 14:01 
AnswerRe: mySql in my application Pin
Paul Conrad30-Oct-05 18:36
professionalPaul Conrad30-Oct-05 18:36 
GeneralRe: mySql in my application Pin
Sasuko30-Oct-05 21:30
Sasuko30-Oct-05 21:30 
GeneralRe: mySql in my application Pin
Paul Conrad31-Oct-05 4:54
professionalPaul Conrad31-Oct-05 4:54 
QuestionORDER BY @Variable??? Pin
Carl Mercier29-Oct-05 10:43
Carl Mercier29-Oct-05 10:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.