Hi,
I'm trying to retrieve data from ms access database. Here's the simple code
This is only showing the first record from the item table (e.g. item.id 1 not item.id 3). I guess I am doing something wrong with the recordset (mRS) and not with the select statement because the following statement works fine.
I've been scratching my head for more than an hour now
Any help would be much appreciated 
I'm trying to retrieve data from ms access database. Here's the simple code
VB.NET:
Private mADOConnect As New ADODB.Connection()
Private mRS As New ADODB.Recordset()
mADOConnect.Open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\pr\HQ.mdb")
mRS.Open("item", mADOConnect, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
[B]query = "select item.instock from item where item.id=3"[/B]
mADOConnect.Execute(query)
[COLOR="Red"]stk = mRS.Fields(0).Value[/COLOR]
mRS.Close()
mADOConnect.Close()
This is only showing the first record from the item table (e.g. item.id 1 not item.id 3). I guess I am doing something wrong with the recordset (mRS) and not with the select statement because the following statement works fine.
VB.NET:
query = "update item set instock=" & newstk & " where item.id=3"
mADOConnect.Execute(query)
I've been scratching my head for more than an hour now
Last edited: