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

Database

 
QuestionSelect with a select Pin
j1webb1-Nov-05 9:54
j1webb1-Nov-05 9:54 
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 
Hi,

i need help in using ADO 2.5 objects with VB 6.0 (i know there're a lot newer version but i need to use this one...)
i'm not an expert in DB programming but i almost go crazy, maybe i'm just too stupid...

1st)
why does Recordset.RecordCount always return -1, even if it DOES contain several records?
i read somewhere that it's neccessary to first call Recordset.MoveLast and set Recordset.CursorLocation
to adUseClient, but this makes no difference at all


2nd)
<br />
    Dim uDB as Connection<br />
    Dim rs as Recordset<br />
<br />
    Set uDB = new Connection<br />
    Set rs = new Recordset<br />
<br />
    uDB.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source = " & db_directory<br />
    If uDB.state <> adStateOpen Then<br />
        MsgBox "Opening database failed."<br />
        Exit Sub<br />
    End If<br />
<br />
    For i = 0 to X<br />
       rs.Open "SELECT * FROM " & TableName & " WHERE ID = " & CStr(id), uDB, adOpenDynamic,   adLockOptimistic<br />
<br />
       'update some fields<br />
       rs.Update<br />
       rs.Close<br />
    Next i<br />


this works well for the first loop pass, but raises an "sql syntax error in select statement" up from the second pass. why?

3rd)
<br />
    On Error Goto ErrHandler<br />
    rs.Filter = "ID = " & CStr(id)<br />


immediately exits my sub without jumping to the error handler, but

<br />
    On Error Resume Next<br />
    rs.Filter = "ID = " & CStr(id)<br />

works fine and also selects the correct records. why ?

4th)
<br />
    rs.Open "SELECT * FROM " & TableName, uDB, adOpenDynamic, adLockBatchOptimistic<br />
    For i = 0 To X<br />
        rs.AddNew<br />
        'update new field<br />
        rs.Update  'also tried without calling Update...<br />
    Next i<br />
    rs.UpdateBatch<br />

shows now error but simply does nothing Frown | :( ... why?
(while opening the recordset with adLockOptimistic and only calling Update works fine)

5th) are there any restrictions in general on adding / altering data with recordsets that were
opened with a select statement?

6th)
<br />
    For i = 0 To X<br />
       'do something<br />
       sqlCmd = "UPDATE " & TableName & " SET field1 = '" & strField1 & "', field2 = '" & strField2 & "' WHERE ID = " & CStr(id) & " AND LANGUAGE_ID = " & CStr(langId)<br />
       uDB.Execute sqlCmd<br />
    Next i<br />

this works also fine in the first pass but returns a "sql syntax error in update statement" up from the second pass...!??

thx a lot for any answers.
daniel.
AnswerRe: 1000 ADO problems... Pin
jonathan151-Nov-05 23:35
jonathan151-Nov-05 23:35 
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 

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.