vb.net Á¬½ÓSQLÊý¾Ý¿â
'ÔÚÒýÓÃÀïÌí¼ÓADODB
Public vscn As ADODB.Connection
Public SQLString As String
SQLString = "Provider=SQLOLEDB.1;Password=ÃÜÂë;Persist Security Info=True;User ID=ÓÃ" & _
"»§;Initial Catalog=Êý¾Ý¿âÃû;Data Source=·þÎñÆ÷Ãû"
vscn = New ADODB.Connection
With vscn
.Mode = ADODB.ConnectModeEnum.adModeReadWrite
.CursorLocation = ADODB.CursorLocationEnum.adUseClient
.ConnectionString = SQLString
.ConnectionTimeout = 60
.Open()
End With
Ïà¹ØÎĵµ£º
½ñÌìÔÚµ÷ÊԵĹý³ÌÖз¢ÏÖ ÔÚvbÖÐÆ´SQLµÄʱºò·¢ÏÖ"()" ×÷Óúܴó
eg: table: T_TEST col : T_KB int ,S_CD int ,Z_SU int
dim gcstrT_1 ,gcstrT_3 as integer
gcstrT_1 = 1
gcstrT_3 = 3
strWhere = strWhere & "……"
strWhere = strWhere & "AND ((T_K ......
±È½Ï³£ÓõÄSQLÓï¾äÓï·¨(Oracle)
Ò».Êý¾Ý¿ØÖÆÓï¾ä (DML) ²¿·Ö
1.INSERT (ÍùÊý¾Ý±íÀï²åÈë¼Ç¼µÄÓï¾ä)
INSERT INTO ±íÃû(×Ö¶ÎÃû1, ×Ö¶ÎÃû2, ……) VALUES ( Öµ1, Öµ2, ……);
INSERT INTO ±íÃû(×Ö¶ÎÃû1, ×Ö¶ÎÃû2, ……) SELECT ×Ö¶ÎÃû1, ×Ö¶ÎÃû2, …&he ......
ÕâһƪÎÒÔÙ˵˵ˮ¾§±¨±íµÄÇé¿ö¡£ACCESSÖжÔӦˮ¾§±¨±í·½Ã棬´ó¼Ò¿ÉÄÜ»áÓöµ½µÄ×î¶àµÄÎÊÌâÓ¦¸Ã¾ÍÊÇ´ò¿ª±¨±íºó
»á³öÏÖÐèÒªµÇ¼µÄÎÊÌâ¡£
Õâ¸öÊÇΪʲôÄØ£¿Ã÷Ã÷ÎÒûÓÐÉèÖÃÃÜÂ룬Ôõô»áÓÐÒªÊäÈëÃÜÂëÄØ£¿Èç¹ûÄã¹»³Á×Å£¬Èç¹ûÄãµÄdebug¾Ñ鲻ȱ·¦µÄ»°£¬
Äã»á·¢ÏÖÔÚË®¾§±¨±íÌø³öÊäÈëÃÜÂëµÄµÇ¼¿òÖУ¬accessµÄ·¾¶²»ÊÇÎÒÏÖÔÚÊý¾Ý¿â· ......
Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡¢ËµÃ÷£º±¸·Ýsql server
--- ´´½¨ ±¸·ÝÊý¾ÝµÄ device
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'
--- ¿ªÊ¼ ±¸·Ý
BACKUP DATABASE pubs TO testBack
4¡¢Ëµ ......