欢迎来到“侍亲必读”
OleDb数据库连接的三种方法
-
Posted on
2017-12-30
1)连接SQL Server数据库
Dim oleDbConnection1 As OleDb.OleDbConnection
Dim Connect As Sting=“Provider=SQLOLEDB;Persist Security Info=False; Data Source=服务器名;Initial Catalog=数据库名;User ID=sa;Password=;”
oleDbConnection1=New System.Data.OleDb.OleDbConnection(Connect)
2)连接Access数据库
假设要连接的Access数据库名为“Example.mdb”,存放在d:\\Data\\目录下。
Dim oleDbConnection1 As OleDb.OleDbConnection
Dim Connect As Sting=“Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\Data\\ Example.mdb”
oleDbConnection1= New System.Data.OleDb.OleDbConnection(Connect)
3)连接Oracle数据库
Dim oleDbConnection1 As OleDb.OleDbConnection
Dim Connect As Sting=“Provider=MSDAORA;Data Source=服务器名;User ID=用户ID;Password=密码;”
oleDbConnection1= New System.Data.OleDb.OleDbConnection(Connect)
SQL的基本语法介绍
-
Posted on
2018-01-01
1)查询
select * from bill
2)更新
update bill set col=1 where id=1
3)删除
delete from bill where id=1