有什么我需要参考的吗?我该如何使用:
Dim fso As New FileSystemObject
Dim fld As Folder
Dim ts As TextStream
Run Code Online (Sandbox Code Playgroud)
我收到错误,因为它无法识别这些对象.
我试图用以下代码查询MySQL数据库:
'declare the variables
Dim Connection
Dim Recordset
Dim SQL
'declare the SQL statement that will query the database
SQL = "SELECT * FROM CUSIP"
'create an instance of the ADO connection and recordset objects
Set Connection = CreateObject("ADODB.Connection")
Set Recordset = CreateObject("ADODB.Recordset")
'open the connection to the database
Connection.Open "DSN=CCS_DSN;UID=root;PWD=password;Database=CCS"
Recordset.CursorType=adOpenDynamic
'Open the recordset object executing the SQL statement and return records
Recordset.Open SQL,Connection
Recordset.MoveFirst
If Recordset.Find ("CUSIP_NAME='somevalue'") Then
MsgBox "Found"
Else
MsgBox "Not Found"
End If
'close the …Run Code Online (Sandbox Code Playgroud)