' Build Query Statement
Dim varQuery
varQuery = "SELECT OBJECTID FROM SIGNS_STANDALONETABLE WHERE ANGLE = 270"
' Set up recordset query
Dim pRS6
Set pRS6 = pDS6.Execute(varQuery)
' Move first
pRS6.MoveFirst
Do While Not pRS6.EOF
Dim MaxID, MaxID2
MaxID = pRS6.Fields("OBJECTID").Value
MaxID2 = MaxID2 & ", " & MaxID
pRs6.MoveNext
Loop
msgbox "Max ID: " & MaxID2varQuery = "SELECT OBJECTID FROM SIGNS_STANDALONETABLE WHERE ID = "01NW-001" "
Dim varUniqueID varUniqueID = "01NW-001" varQuery = "SELECT OBJECTID FROM SIGNS_STANDALONETABLE WHERE ID = " & varUniqueID & " "
varQuery = "SELECT OBJECTID FROM SIGNS_STANDALONETABLE WHERE ID = "01NW-001" "
varQuery = "SELECT OBJECTID FROM SIGNS_STANDALONETABLE WHERE ID = " & chr(34) & "01NW-001" & chr(34) "
varQuery = "SELECT OBJECTID FROM SIGNS_STANDALONETABLE WHERE ID = " & chr(34) & "01NW-001" & chr(34)
I try this:
varQuery = "SELECT OBJECTID FROM SIGNS_STANDALONETABLE WHERE ID = '01NW-001' "
and when I do a message box on varQuery I get
SELECT OBJECTID FROM SIGNS_STANDALONETABLE WHERE ID = '01NW-001'
and nothing happens, ie the query is not returning anything...
Thoughts?
Thanks everyone for yoru help...its very appreciated...this is so simple dont know why its so tough
It seems no record is retured based on your query definition.
I am not sure what is exactly in your data. But if you open ArcPad Studio, then open the SIGNS_STANDALONETABLE table.
Delete the "SELECT * FROM [SIGNS_STANDALONETABLE]" in the data view window,
copy
SELECT OBJECTID FROM SIGNS_STANDALONETABLE WHERE ID = '01NW-001'
to the window and excute the command by click on "!" on toolbar.
If the SQL sentence is wrong, error warnings will appear;
if nothing is wrong, but no record returns, you need to make sure the Field is a string field and field value is exactly what you want to query for.