Home > Software engineering >  Use ado controls link in vb6.0 by use of excel how to query?
Use ado controls link in vb6.0 by use of excel how to query?

Time:10-15

Thank you very much
This is the code window:
Private Sub Command1_Click ()
Adodc1. RecordSource=SQL
SQL="select * from 1"
Adodc1. Refresh
End Sub

This is ado properties window



Mainly want to ask what should fill in the red box, I think there is fill in the red box area error
I made a mistake, or the SQL code has a problem?
Please you solve
Thank you



CodePudding user response:

In addition, using Microsoft. Jet. The OLEDB. 4.0

CodePudding user response:

You connect Excel data table is confirmed?
 
Adodc1. The ConnectionString="Provider=Microsoft. Jet. The OLEDB. 4.0; Data Source=E: \ workbook \ linshi1\1. XLS. Extended Properties=8.0 "" Excel; HDR=Yes; IMEX=1 ", "
"
Adodc1. RecordSource="SELECT * FROM TOP 1 [Sheet1 $]"

Adodc1. Refresh
  • Related