Home > Backend Development > PHP Tutorial > A method to migrate data from Microsoft SQL Server 7.0 to MySQL (transfer) - database phase_PHP tutorial

A method to migrate data from Microsoft SQL Server 7.0 to MySQL (transfer) - database phase_PHP tutorial

WBOY
Release: 2016-07-13 16:58:19
Original
854 people have browsed it

Presumably everyone likes to use Word for typing, Excel for calculation and planning, and PowerPoint for slide presentation...but this only uses a very small part of the functions of the Office series products. According to surveys, the vast majority of users only use 20% of the functions of Office products, and few people pay attention to Visual Basic for Application. In fact, being familiar with the functions of VBA can make your work twice the result with half the effort. Especially for accounting, finance and other majors, making a good set of macros can almost solve the problem once and for all! Recently, VBA functions have been added to AutoCAD, which cannot but be said to be a trend!
The function of VBA is not only used by virus makers to cause trouble. The fact that VBA can be used to create viruses also illustrates its power and ease of use! Using ADO objects, you can perform database operations very conveniently! The following is a simple example of data exchange:
Since ADO objects do not directly support MySQL, MyODBC must be installed first. The latter is also a free product and can be downloaded from www.mysql.org. Once MyODBC is installed, You can configure a data source name in ODBC data source management and point it to the MySQL database you want to connect to. The code is as follows:
Sub connectMySQL()
'Connect to the MySQL database through MyODBC and transfer the data from Microsoft SQL Server 7
' into 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 an object connection
Dim rs As New ADODB.Recordset 'Declare and create an object record set
Dim cm As New ADODB.Command 'Declare and create object commands

sConnect = "dsn=mysql1" 'Specify the data source name of MySQL
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," & _

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631439.htmlTechArticleI think everyone likes to use Word for typing, Excel for calculation and planning, and PowerPoint for slide presentation... , but this only uses a small part of the functions of the Office series products. ...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template