当前位置:网站首页>Connecting MySQL database with VBScript_ Old bear passing by_ Sina blog
Connecting MySQL database with VBScript_ Old bear passing by_ Sina blog
2022-06-25 23:54:00 【wenroudelang8888】
1. Installation is required first mysql-connector-odbc-3.51.15-win32.msi( The next step between the installation process )
(PS: It should be noted that odbc yes 32 A still 64 Bit depends on your computer / On the remote computer mysql yes 32 A still 64 position , It doesn't depend on your computer system )
Open the control panel --》 Management tools
double-click data source (ODBC)
Click on add to
choice mysql odbc 5.1 driver --》 Click finish
Fill in data source name (DSN), Later in the program, we will use
Fill in server Address , It's usually localhost, If it is a remote computer, fill in the remote address
Fill in user name 、 password 、 Database name --》 Click test
If the test is successful , be odbc Setup complete , Click on ok Complete data source addition

2. And this is where vbs The program uses :
Const USERNAME = "root"
Const PASSWORD = "12345"
Const strConn = "dsn=mysql;driver={MySQL ODBC 5.1 Driver};
server=localhost;uid="&USERNAME&";pwd="&PASSWORD&";database=test;port=3306;"
Set conn = CreateObject("adodb.connection")
conn.Open strConn
Set rs = CreateObject("adodb.recordset")
rs.Open ssql, conn, 1, 3
rs.MoveFirst
Do Until rs.EOF
WScript.Echo rs.Fields("name")
rs.MoveNext
Loop
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
' Display the data
' set rs=server.CreateObject("adodb.recordset")
' sql="select * from zhu_sql where i=2;"
' rs.open sql,conn,1,1
' Other increase 、 Delete 、 Change
'conn.execute(sql)
Problems encountered :
Microsoft OLE DB Provider for ODBC Drivers (3, 1) : [Microsoft][ODBC Driver manager ] At the designated DSN in , Architecture mismatch between driver and Application
This is because I installed mysql yes 32 position But I installed odbc yes 64 position Of , Just install 32 Bit odbc Or install 64 Bit mysql that will do !
边栏推荐
猜你喜欢

用frp搭建云电脑

猕猴桃酵素的功效_过路老熊_新浪博客

解析產品開發失敗的5個根本原因

Unable to start debugging. Unexpected GDB output from command “-environment -cd xxx“ No such file or

博图软件中多重背景块的建立_过路老熊_新浪博客

One article explains R & D efficiency! Your concerns are

idea 查看单元测试覆盖率

CXF
![mysql5.7版本在配置文件my.ini[mysqld]加上skip-grant-tables后无法启动](/img/b2/2b87b3cea1422e2a860f5e0e7dcc40.png)
mysql5.7版本在配置文件my.ini[mysqld]加上skip-grant-tables后无法启动

社交网络可视化第三方库igraph的安装
随机推荐
为什么Integer的比较最好使用equals
Can I upload pictures without deploying the server?
动态验证码
Use Baidu map API to set an overlay (infowindow) in the map to customize the window content
Unsigned and signed vernacular
static关键字详解
Circuit de fabrication manuelle d'un port série de niveau USB à TTL pour PL - 2303hx Old bear passing Sina blog
unsigned与signed之大白话
别再吃各种维生素C片了,这6种维生素C含量最高的水果
剑指 Offer 48. 最长不含重复字符的子字符串
Uniapp -- framework arrangement and analysis summary
Virtual and pure virtual destructors and their implementation in c++
树莓派开机发送热点进行远程登录
Studio5k v28安装及破解_过路老熊_新浪博客
一文讲透研发效能!您关心的问题都在
Final and static
关于运行scrapy项目时提示 ModuleNotFoundError: No module named 'pymongo‘的解决方案
STEP7主站与远程I/O组网_过路老熊_新浪博客
Object类常用方法
php socket通信中stream_select方法的理解