Home > Software engineering >  Beg god for help, to run the program always prompt object refresh methods Iadodc failed. Look at the
Beg god for help, to run the program always prompt object refresh methods Iadodc failed. Look at the

Time:09-24

 Private Sub Optinformation_Click (Index As an Integer) 
Dim s As String
The Select Case Index
Case 0
S=InputBox (" please enter a driving experience to query: ")
Adodc1. RecordSource="select * from traffic accident information where driving experience like '%" & amp; S & amp; "% '
"Adodc1. Refresh
DataGrid1. Refresh
Case 1
S=InputBox (" please input to query: illegal behavior ")
Adodc1. RecordSource="select * from traffic accident information where the violations like '%" & amp; S & amp; "% '
"Adodc1. Refresh
DataGrid1. Refresh
Case 2
S=InputBox (" please input to query the accident of time: ")
Adodc1. RecordSource="select * from traffic accident information where accident time like '%" & amp; S & amp; "% '
"Adodc1. Refresh
DataGrid1. Refresh
Case 3
S=InputBox (" please enter a gender to query: ")
Adodc1. RecordSource="select * from traffic accident information where sex like '%" & amp; S & amp; "% '
"Adodc1. Refresh
DataGrid1. Refresh
End the Select
End Sub

CodePudding user response:

May need to register in advance Iadodc rely on controls,

In a 64 - bit Windows:
64 exe and DLL in the directory c: \ Windows \ sys tem32 directory.
32 bit exe and DLL in the directory c: \ Windows \ sys wow64 directory.
So pay attention to:
In win64 system registered under 32-bit ocx DLL to 32 ocx or copy the DLL to the c: \ Windows \ syswow64 \ directory,
And registered to c: \ Windows \ syswow64 \ regsvr32 XXXXXXX ocx or DLL
Under win64 a system set up 32-bit programs use a database alias to c: \ Windows \ \ syswow64 \ cliconfg exe
Under win64 a system set up a 32-bit application system DSN to c: \ Windows \ \ syswow64 \ odbcad32 exe

CodePudding user response:

You can detail again? I didn't understand specific how to operate, copy should put something in the past

CodePudding user response:

What type of variable is Adodc1?

CodePudding user response:

Adodc connection string?

CodePudding user response:

SQL statements in the field are all character data type, there is no problem,
DataGrid1. Refresh seems to be wrong, it should be:
The Set DataGrid1.=Adodc1 'DataSource in DataGrid1 display data
  • Related