CANNOT GET ID - SQL NEED HELP

lucas555

Member
Licensed User
Longtime User
Hello all,
I'am having a problem of getting an ID from the data base.
This is my Code

Dim PickingSlipNo

Query = "SELECT MAX([PickingNo]) As PickingNo" & CRLF & _
"Table1" & CRLF & _
"WHERE [dbo].[OE_PICKINGSLIP_Header].[OrderNo] = " & OrderNo

openconn
Conn.ExecuteQuery(Query)
PickingSlipNo = conn.ReadField("PickingNo")

The openconn Is a method that opens the connection to the DB. The connection is function I have tested it out.

In the PickingSlipNo variable it always return #ERROR# for some reason, all I want him to do is to get the ID of a precise OrderNo.

Need Help with it please help.
 

alanyu

Member
Licensed User
Hello all,
I'am having a problem of getting an ID from the data base.
This is my Code

Dim PickingSlipNo

Query = "SELECT MAX([PickingNo]) As PickingNo" & CRLF & _
"Table1" & CRLF & _
"WHERE [dbo].[OE_PICKINGSLIP_Header].[OrderNo] = " & OrderNo

openconn
Conn.ExecuteQuery(Query)
PickingSlipNo = conn.ReadField("PickingNo")

The openconn Is a method that opens the connection to the DB. The connection is function I have tested it out.

In the PickingSlipNo variable it always return #ERROR# for some reason, all I want him to do is to get the ID of a precise OrderNo.

Need Help with it please help.




B4X:
Query = "SELECT MAX([PickingNo]) As PickingNo" & CRLF & _
"Table1" & CRLF & _
"WHERE [dbo].[OE_PICKINGSLIP_Header].[OrderNo] = " & OrderNo
openconn
Conn.ExecuteQuery(Query)
Conn.Advance    'Here the lack of a code
PickingSlipNo = conn.ReadField("PickingNo")
 

lucas555

Member
Licensed User
Longtime User
Thanks aLOT alanyu, can't believed it was only a minor problem. Was getting really impatient lo
 
Top