Why can't read data,I use FieldCount command returns 4 data contained,But when I use ReadField command to get the data, always prompt "#ERROR#"
I'm going crazy, who can help me
Version=6.90
NumberOfForms=1
Form1=Form1
FormWidth=240
FormHeight=268
IconFile=
NumberOfDesktopIncludes=1
DesktopInclude1=MSSQL.dll
NumberOfDeviceIncludes=1
DeviceInclude1=MSSQL.dll
NumberOfObjects=1
Object1=mssql:MSSQL
NumberOfModules=0
Sub designer
addform(Form1,"Form1","",220,220,220)@
addlabel(form1,Label1,45,155,175,25,"Label1",220,220,220,0,0,0,True,True,9,False)@
addtextbox(form1,TextBox3,80,75,75,22,"TextBox3",255,255,255,0,0,0,True,True,False,9)@
addtextbox(form1,TextBox2,80,45,75,22,"TextBox2",255,255,255,0,0,0,True,True,False,9)@
addtextbox(form1,code,80,10,75,22,"TextBox1",255,255,255,0,0,0,True,True,False,9)@
addbutton(form1,Button1,80,120,75,23,"Button1",212,208,200,0,0,0,True,True,9)@
End Sub
@EndOfDesignText@
Sub Globals
End Sub
Sub App_Start
form1.Show
Mssql.New1
Dim connected As Boolean
server="SQL5004.Smarterasp.net"
port="1433"
database="DB_9AACA3_alan"
login="DB_9AACA3_alan_admin"
pass="blq4ever"
connected = Mssql.Open("Persist Security Info=false;Integrated Security=false;Server=" & server & ", " & port &"; initial catalog=" & database & "; user id="& login & "; password=" & pass)
If connected = True Then
Label1.Text="server has been connect "
Else
Msgbox("Unable to connect to server")
End If
End Sub
Sub Button1_Click
Mssql.ExecuteQuery("Select * FROM Warehouse WHERE barcode='" & code.Text & "'") 'Command is unavailable
'Mssql.ExecuteQuery("UPDATE Warehouse SET test3 = 'wa3' WHERE barcode ='1'") 'Commands are available
'Mssql.ExecuteNonQuery("UPDATE Warehouse SET test3 = 'waaa3' WHERE barcode ='1'") 'Commands are available
TextBox2.Text=Mssql.ReadField("test2")
TextBox3.Text=Mssql.ReadField("test3")
ss=Mssql.FieldCount
Msgbox(ss)
Mssql.Close
End Sub
I'm going crazy, who can help me
Version=6.90
NumberOfForms=1
Form1=Form1
FormWidth=240
FormHeight=268
IconFile=
NumberOfDesktopIncludes=1
DesktopInclude1=MSSQL.dll
NumberOfDeviceIncludes=1
DeviceInclude1=MSSQL.dll
NumberOfObjects=1
Object1=mssql:MSSQL
NumberOfModules=0
Sub designer
addform(Form1,"Form1","",220,220,220)@
addlabel(form1,Label1,45,155,175,25,"Label1",220,220,220,0,0,0,True,True,9,False)@
addtextbox(form1,TextBox3,80,75,75,22,"TextBox3",255,255,255,0,0,0,True,True,False,9)@
addtextbox(form1,TextBox2,80,45,75,22,"TextBox2",255,255,255,0,0,0,True,True,False,9)@
addtextbox(form1,code,80,10,75,22,"TextBox1",255,255,255,0,0,0,True,True,False,9)@
addbutton(form1,Button1,80,120,75,23,"Button1",212,208,200,0,0,0,True,True,9)@
End Sub
@EndOfDesignText@
Sub Globals
End Sub
Sub App_Start
form1.Show
Mssql.New1
Dim connected As Boolean
server="SQL5004.Smarterasp.net"
port="1433"
database="DB_9AACA3_alan"
login="DB_9AACA3_alan_admin"
pass="blq4ever"
connected = Mssql.Open("Persist Security Info=false;Integrated Security=false;Server=" & server & ", " & port &"; initial catalog=" & database & "; user id="& login & "; password=" & pass)
If connected = True Then
Label1.Text="server has been connect "
Else
Msgbox("Unable to connect to server")
End If
End Sub
Sub Button1_Click
Mssql.ExecuteQuery("Select * FROM Warehouse WHERE barcode='" & code.Text & "'") 'Command is unavailable
'Mssql.ExecuteQuery("UPDATE Warehouse SET test3 = 'wa3' WHERE barcode ='1'") 'Commands are available
'Mssql.ExecuteNonQuery("UPDATE Warehouse SET test3 = 'waaa3' WHERE barcode ='1'") 'Commands are available
TextBox2.Text=Mssql.ReadField("test2")
TextBox3.Text=Mssql.ReadField("test3")
ss=Mssql.FieldCount
Msgbox(ss)
Mssql.Close
End Sub