Ask everybody to help, a little nasty,
Private Sub Form_Load ()
Dim mpath $, mlink $
Mpath=App. Path 'access to the Path of the program
If Right (mpath, 1) & lt;> "" Then mpath=mpath + "" determine whether subdirectories for
'the following two lines of code can synthesize 1, mlink deposit the ConnectionString property set values
Mlink="Provider=Microsoft. Jet. The OLEDB. 4.0;" 'specify the provider
Mlink="Data Source=" + mpath mlink + + VB. MDB "" 'in the database file name before insert path
Adodc1. The ConnectionString set connection properties
=mlink 'Adodc1.Com mandType=adCmdUnknown
Adodc2. The ConnectionString set connection properties
=mlink 'Adodc2.Com mandType=adCmdUnknown 'designated record set command type (which can be specified when the design)
Adodc3. The ConnectionString set connection properties
=mlink 'Adodc3.Com mandType=adCmdUnknown 'designated record set command type (which can be specified when the design)
Adodc4. The ConnectionString set connection properties
=mlink 'Adodc4.Com mandType=adCmdUnknown
Adodc5. The ConnectionString set connection properties
=mlink 'Adodc5.Com mandType=adCmdUnknown
Adodc6. The ConnectionString set connection properties
=mlink 'Adodc6.Com mandType=adCmdUnknown
Adodc7. The ConnectionString set connection properties
=mlink 'Adodc7.Com mandType=adCmdUnknown
Adodc8. The ConnectionString set connection properties
=mlink 'Adodc8.Com mandType=adCmdUnknown
Adodc1. RecordSource="select * from details"
Adodc1. Refresh
Adodc2. RecordSource="details the select product name from"
Adodc2. Refresh
Adodc3. RecordSource="details the select product name from"
Adodc3. Refresh
Adodc8. RecordSource="details the select product name from"
Adodc8. Refresh
Adodc5. RecordSource="select sum (price * number) as the total price list from buying the where the user code='" & amp; Val (Label12 Caption) & amp; "'
" Adodc5. Refresh
Adodc7. RecordSource="select * from customer YSNLKI code table"
Adodc7. Refresh
Adodc7. You. MoveLast
Label12. Caption=Adodc7. You. Fields (0)
Adodc4. RecordSource="select * from buying list where the user code='" & amp; Val (Label12 Caption) & amp; "'
"Adodc4. Refresh
If Adodc4. You. EOF=True And Adodc4. You. BOF=True Then
Commandshanchu. Enabled=False
Command3. Enabled=False
Command4. Enabled=False
The Else
Commandshanchu. Enabled=True
Command3. Enabled=True
Command4. Enabled=True
End the If
End Sub
CodePudding user response:
Field names don't match, you can post the SQL string Access in debugging, it will tell you which one is wrong,CodePudding user response:
This is basically the SQL statements you have any question, you can separate the debug. Print it out and see.Also, why so many connections to open the same data file? Do you want to test the access database performance of concurrent connections?