|
-
Apr 11th, 2002, 04:19 AM
#1
Thread Starter
Lively Member
Another (maybe simple) ADO question
I want to know how I can convert this DOA code:
Code:
Case CMD_ADDRCD, CMD_EDITRCD, CMD_DELRCD
FindCrit = "ArtikelID>=" & GetParmInString(gsFormParm, 2)
datPrimaryRS.Recordset.FindFirst (FindCrit)
If (datPrimaryRS.Recordset.RecordCount <> 0) And _
datPrimaryRS.Recordset.NoMatch Then
datPrimaryRS.Recordset.MoveFirst
End If
I though it would be something like this, it is just that NoMatch is not accepted:
Code:
Case CMD_ADDRCD, CMD_EDITRCD, CMD_DELRCD
FindCrit = "ArtikelID>=" & GetParmInString(gsFormParm, 2)
rs.Find (FindCrit)
If (rs.RecordCount <> 0) And _
rs.NoMatch Then
rs.MoveFirst
End If
The WiseGuy
I stuck my head out of the window and got arrested for mooning!
This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
O/S: Windows XP Professional (dutch)
Internet: Cable (1Mbit connection)
-
Apr 11th, 2002, 04:35 AM
#2
Does the find return a success value ?
If so use that to determine whether to goto the first record or not.
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Apr 11th, 2002, 04:53 AM
#3
Thread Starter
Lively Member
The problem is that I don't completely understand the code especially this part:
FindParm = GetParmInString(gsFormParm, 2)
so maybe you can explain it a little bit for me?
WiseGuy
I stuck my head out of the window and got arrested for mooning!
This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
O/S: Windows XP Professional (dutch)
Internet: Cable (1Mbit connection)
-
Apr 11th, 2002, 05:08 AM
#4
Put the mouse over it, click the Right mouse button and select "definition".
I don't know but it looks like a custom function.
I can guess that it supplies (possibly) the second value of a list or the first to characters. Although it could be anything.
It's more likely to return an id number though...
Is this your project ? If the definition doesn't work try highlighting the word and pressing F1 (for help on it).
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Apr 11th, 2002, 05:49 AM
#5
Frenzied Member
ADO recordsets don't have a NoMatch property. If the record isn't found, I think you end up at the end of the recordset. This code should do it:
VB Code:
Case CMD_ADDRCD, CMD_EDITRCD, CMD_DELRCD
FindCrit = "ArtikelID>=" & GetParmInString(gsFormParm, 2)
rs.Find (FindCrit)
'If (rs.RecordCount <> 0) And rs.NoMatch Then
If (rs.RecordCount <> 0) And rs.EOF Then
rs.MoveFirst
End If
-
Apr 11th, 2002, 06:43 AM
#6
Thread Starter
Lively Member
Well I gues it works, becouse I'm not getting any errors but my datagrid isn't filled yet how can I enter some SQL stuff I thought it was somthing like this but it doesn't work:
SQL="select * from artikelen"
apperantly you need to declare 'SQL' but how, or is there a whole ather was to execute sql?
btw the name of the datagrid is grdDataGrid
many thanks in advance,
The WiseGuy
I stuck my head out of the window and got arrested for mooning!
This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
O/S: Windows XP Professional (dutch)
Internet: Cable (1Mbit connection)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|