VBS connection database, reference point data
' Establish a connection
Dim Cnn ' Define database connection string
Set Cnn = CreateObject ("ADODB. Connection ")
Sql= "dsn=*;D atabase=*; pwd=*; server=*; Uid=* "
cnn.connectionstring = sql
Cnn.open ' Open database connection
If cnn.state <> 0 Then ' to determine if the database connection was successful
WScript.Echo "Database Connection succeeded"
Else
WScript.Echo "Database Connection Failed"
Wscript.Quit
End If
' Open record
Dim rs,ssql
Set rs = CreateObject ("Adodb.recordset")
Ssql= "Select ColumnName from tablename"
Rs. Open sSQL, Cnn, 1, 3
Rs. MoveFirst
' Read records
Do Until Rs. Eof
WScript.Echo Rs. Fields ("ColumnName")
Rs. MoveNext
Loop
' Release resources
Rs. Close
Cnn.close
Set rs = Nothing
Set Cnn = Nothing
Note: After setting the data source in ODBC, fill in the * string
Finally successfully found: drawings