One way to migrate data from Microsoft SQL Server 7.0 to MySQL (GO)-Database phase _php Tutorial

Source: Internet
Author: User
Presumably everyone likes to use Word typing, calculate and plan with Excel, PowerPoint slides to show ..., but this only uses a small part of the Office family of features. According to the survey, most users use only 20% of the functionality of Office products, and few people notice visual Basic for application. In fact, familiar with the function of VBA can make your work more effective, especially for accounting, finance and other professional, make a good macro, almost can be done once and for all! Recently, AutoCAD has also added the functionality of VBA, which cannot be said to be a trend!
The functionality of VBA is never just for the virus maker to make trouble, and VBA can be used to create viruses while also explaining its powerful and easy-to-use features! The use of ADO objects, can be very convenient database operation! Here is an example of a simple data exchange:
Because ADO object does not directly support MySQL, so must first install MYODBC, the latter is a free product, download on www.mysql.org, installed MYODBC, you can configure a data source name in the ODBC data source management, Point it to the MySQL database you want to connect to. The code is as follows:
Sub Connectmysql ()
' Connect to the MySQL database via MYODBC, and Microsoft SQL Server 7
' data to be transferred 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 ' declares and creates an object record set
Dim cm as New Adodb.command ' declares and creates object commands

Sconnect = "DSN=MYSQL1" ' specifies the data source name for MySQL
Cnmysql.open sconnect ' connected 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, Softdesc blob, "& _

http://www.bkjia.com/PHPjc/631439.html www.bkjia.com true http://www.bkjia.com/PHPjc/631439.html techarticle Presumably everyone likes to use Word typing, calculate and plan with Excel, PowerPoint slides to show ..., but this only uses a small part of the Office family of features. ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.