Unanswered: Starting Counter in vb ,Access as back end
Iam using VB6 ADO & i want to start a counter from one & so on.
Suppose i want to store the Patient Numbers .I want
that when the form is load automatically i can see 1 in the Label box.
I use the following query with VB6 & Oracle (SQL) as back end.It works fine
but i want to do it Microsoft Access.In my opinion MS Access does't recognize NVL function. So how can i solve my
problem ? The Code gernerate a Run time error
which is as under.
Runtime error '-2147217900(80040e14)':
[Microsft][ODBC Microsoft Access driver ] Undefined Function 'NVL'
My code is as under
Private Sub Form_Load()
Set RST = cn.Execute("Select NVL(Max(Roll),0)+1 as C from Student")
If Not IsNull(RST.Fields("C")) Then
lblPid_value.Caption = RST.Fields("C").Value
lblPid_value.Caption = 1