"Project"--"Add module", the new module generated is the public module of this project.
The so-called subroutine is under this project. Whether it is a SUB or Function belonging to a form or a module, it is a subroutine.
Whether it is a variable or a procedure declared with Public in a public module, it can be referenced in the entire project.
conn.Open connectionstring The purpose of this statement is to open an ADODB connection named book.mdb. By using this connection, you can operate on the database in controls or code. Therefore, this code is usually placed before operating on the database. If you are using a control, place it at the beginning of the Form_load event or control-related events. If you use code, just put it before the code.
The above is my understanding, but I am also a newbie, so there may be something wrong.
When is this assignment due?
Private Sub Command1_Click()
Dim n As Integer
Dim sum As Double
sum = 0
n = InputBox ("Please enter the value of n")
For i = 1 To n
sum = sum jiecheng(i)
Next i
Print sum
End Sub
Public Function jiecheng(ByVal n As Integer) As Double
Dim jc As Double
jc = 1
For i = 1 To n
jc = jc * i
Next
jiecheng = jc
End Function
The above is the detailed content of Please tell me about the problem of connecting the VB library management system to the database. For more information, please follow other related articles on the PHP Chinese website!