Home > Software engineering >  Visual basic
Visual basic

Time:10-06

 Private Sub Command3_Click () 
Dim number As Integer
Number=InputBox (" please input the query sequence number ", "query")
Asearch.Com mandType=adCmdText
Asearch. RecordSource="select * from queuing simulation where the serial number=" & amp; Number & amp; "
"Asearch. Refresh
If Asearch. You. RecordCount=0 Then
MsgBox "the serial number is not in system, please enter the serial number again,"
End the If
The Set DataGrid1. The DataSource=Asearch
End Sub


Runtime, why such mistakes: Microsoft jet database engine can't find the input table or 'queuing simulation, make sure it exists, and its name spelling is correct, and real-time error: object' Refresh 'method' Adodc failed, but after checking, table and spelling are correct, why still wrong? Solving!!!!!!

CodePudding user response:

May Asearch. The ConnectionString is not correct,

CodePudding user response:

Program to access the database are you open to check the one,

CodePudding user response:

Yes, no problem

CodePudding user response:

Asearch. Open a success?

CodePudding user response:

Do the table name in Chinese... It is best not to do the table name, in Chinese with English name of the table to try first, database connection success, of course, also want to check it

CodePudding user response:

Select * from queue simulation [] where [number]=

CodePudding user response:

In addition if use adobc control advise you abandoned him, and the control I have received many complaints about the problems he ~

CodePudding user response:

1, Asearch RecordSource="select * from queuing simulation where [number]=" '& amp; Number & amp; "'
"


2, Asearch RecordSource="select * from queuing simulation where [number]=" & amp; Number

With the above a try,

CodePudding user response:

I was using WINSOCK send,

 Function WskPost () As a Boolean 
Dim As Long I
Dim PostSu As Boolean
PostSu=False
I=0
StrCommand=""

StrCommand="POST/noticeCreate. JSP HTTP/1.1" + vbCrLf
StrCommand=StrCommand + "Accept: */*" + vbCrLf
StrCommand=StrCommand + "Accept - Language: useful - cn" + vbCrLf
StrCommand=StrCommand + Referer: "http://119.185.1.0/camion.html" + vbCrLf
StrCommand=StrCommand + "x - requested - with: XMLHttpRequest" + vbCrLf
StrCommand=StrCommand + "content-type: application/x - WWW - form - urlencoded; The charset=utf-8 "+ vbCrLf
StrCommand=StrCommand + "the user-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; The.net CLR 2.0.50727; The.net CLR 3.0.04506.648; The.net CLR 3.5.21022; The.net CLR 3.0.4506.2152; The.net CLR 3.5.30729; . NET4.0 C; . NET4.0 E; AskTbPTV2/5.9.1.14019; 360 se) "+ vbCrLf
StrCommand=StrCommand + "Host: 119.185.1.0" + vbCrLf
StrCommand=StrCommand + "Content - Length:" & amp; Str (Len SendMsg ()) + vbCrLf
StrCommand=StrCommand + "Connection: Keep Alive -" + vbCrLf
StrCommand=StrCommand + "cache-control: no - Cache" + vbCrLf
'strCommand=strCommand + "Accept - Language: useful - CN, useful, *" + vbCrLf
StrCommand=StrCommand + "Accept - Encoding: gzip, deflate" + vbCrLf
StrCommand=StrCommand + vbCrLf
StrCommand=StrCommand + SendMsg + vbCrLf
If wsk1. State & lt;> SckClosed Then wsk1. Close
Wsk1. RemoteHost=Text1. Text
Wsk1. RemotePort=Text2. Text
Wsk1. Connect
The Debug. Print StrCommand
Do Until I & gt;=1000 And wsk1. State=sckOpen
'MsgBox wsk1. State
If wsk1. State=9 Then
'the stat "error", ""
PostSu=False
The Exit Do
End the If
If wsk1. State=sckConnected Then
Wsk1. SendData publishes the event StrCommand
PostSu=True
The Exit Do
End the If
I=I + 1
DoEvents
Loop
WskPost=PostSu
End the Function
  • Related