One way to migrate data from SQLServer7.0 to MySQL. How to migrate data from Microsoft sqlserver7.0 to MySQL Zhbforce I think everyone would like to use Word typing, Excel for computation and planning, PowerPoint for slide presentation ..., How to migrate data from Microsoft SQL Server 7.0 to MySQL
Zhbforce
I think everyone is fond of Word typing, Excel computing and planning, and PowerPoint slides ..., However, this only applies to a few functions of Office products. According to the survey, most users only use 20% of the functions of Office products, and few people have noticed Visual Basic for Application. In fact, being familiar with the functions of VBA can help you get twice the result with half the effort. especially for accounting, finance, and other majors, making a set of good macros can almost always be done once and for all! Recently, the VBA function has been added to AutoCAD. this is a trend!
The functions of VBA are not only troublesome for virus makers. while VBA can be used to create viruses, it also shows that it is powerful and easy to use! Using ADO objects, you can easily perform database operations! The following is an example of a simple data exchange:
Since the ADO object does not directly support MySQL, you must first install MyODBC, which is also a free product. it has been downloaded from www.mysql.org and MyODBC has been installed, you can configure a data source name in ODBC data source management to point it to the MySQL database you want to connect. The code is as follows:
Sub connectMySQL ()
'Use MyODBC to connect to the MySQL database and
'Data is transferred to mysql
Dim sConnect As String, sSql As String, I As Long
Dim cnMSSQL As New ADODB. Connection
Dim cnMySQL As New ADODB. Connection
'Declare and create Object connection
Dim rs As New ADODB. Recordset 'declares and creates an object record set
Dim cm As New ADODB. Command 'declares and creates an object Command
SConnect = "dsn = mysql1" 'specifies the MySQL data source name
CnMySQL. Open sConnect Connect to mysql
SConnect = "Provider = SQLOLEDB.1; Persist Security Info = False; User ID = sa; pwd = 123456; Initial Catalog = softdown; Data Source = ntserver"
'Connect to MS SQL server 7
CnMSSQL. Open sConnect
'Ssql = "create table softinfo (softNum smallint, softname varchar (70), softdesc blob ,"&_
"Softpath varchar (30), softleng varchar (10), softclass varchar (10), softsugest tinyint (1 ),"&_
"Softdown smallint (4)" 'create a new MySQL data table statement
SSql = "select * from softinfo order by softnum"
Rs. Open sSql, cnMSSQL, 1, 1
Http://www.bkjia.com/PHPjc/631203.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631203.htmlTechArticleMicrosoft SQL Server 7.0 data migration to MySQL method Zhbforce presumably everyone is very fond of using Word typing, using Excel for calculation and planning, using PowerPoint for slide presentation ...,...