vb如何连接ORACLE数据库?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vb如何连接ORACLE数据库?相关的知识,希望对你有一定的参考价值。
参考技术A 利用ADO访问Oracle数据库:cn.Open "DRIVER=Microsoft ODBC for Oracle;Server=OracleServer.world;Uid=用户名;Pwd=密码" 参考技术B Oracle数据库连接
摘要:本文用代码形式讲述了Oracle数据库的连接
标签:Oracle 数据库
odbc
new version:
driver=microsoft odbc for oracle;server=oracleserver.world;uid=username;pwd=asdasd;
old version:
driver=microsoft odbc driver for oracle;connectstring=oracleserver.world;uid=myusername;pwd=mypassword;
oledb, oledbconnection (.net)
standard security:
provider=msdaora;data source=myoracledb;user id=username;password=asdasd;
this ones from microsoft, the following are from oracle
standard security:
provider=oraoledb.oracle;data source=myoracledb;user id=username;password=asdasd;
trusted connection:
provider=oraoledb.oracle;data source=myoracledb;osauthent=1;
oracleconnection (.net)
standard:
data source=oracle8i;integrated security=yes;
this one works only with oracle 8i release 3 or later
declare the oracleconnection:
c#:
using system.data.oracleclient;
oracleconnection ooracleconn = new oracleconnection();
ooracleconn.connectionstring = my connectionstring;
ooracleconn.open();
vb.net:
imports system.data.oracleclient
dim ooracleconn as oracleconnection = new oracleconnection()
ooracleconn.connectionstring = my connectionstring
ooracleconn.open()
data shape
ms data shape:
provider=msdatashape.1;persist security info=false;data provider=msdaora;data source=orac;user id=username;password=mypw
例子1:namespace oracle
///
/// webform1 的摘要说明。
///
public class webform1 : system.web.ui.page
protected system.web.ui.webcontrols.datagrid datagrid1;
private dataset mydataset = new dataset();
private void page_load(object sender, system.eventargs e)
// 在此处放置用户代码以初始化页面
string connstring=provider=oraoledb.oracle;data source=jtest;user id=system;password=manager;;
oledbconnection conn=new oledbconnection(connstring);
string strcom = select * from system.lg_task_table;
conn.open();
oledbdataadapter mycommand = new oledbdataadapter(strcom,conn);
mycommand.fill(mydataset,system.lg_task_table);
datagrid1.datasource = mydataset.tables[system.lg_task_table].defaultview;
datagrid1.databind();
conn.close();
VB访问WINCC的过程归档数据库 如何连接及查询?望大虾指教
基本的数据库连接和查询语句能够对用户归档数据可读,但是过程和报警归档不可读,如何读出过程归档中的值。望大虾们不惜口水!
参考技术A 查询过程值归档语法:TAG:R<ValueID
or
ValueName>,<TimeBegin>,<TimeEnd>
查询报警信息归档语法:
ALARMVIEW:SELECT
*FROM<ViewName>[WHERE<condition>...,optional]
详情请参阅《深入浅出Wincc6》一书中的利用ADO/Wincc
OLE
DB访问数据库语法章节。
以上是关于vb如何连接ORACLE数据库?的主要内容,如果未能解决你的问题,请参考以下文章