首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

小弟我想用VB连接oracle,执行这一条更新update yong_a set b=1 where a = (控件test1填进去的数字)

2012-04-10 
我想用VB连接oracle,执行这一条更新update yong_a set b1 where a (控件test1填进去的数字)只需执行这

我想用VB连接oracle,执行这一条更新update yong_a set b=1 where a = (控件test1填进去的数字)
只需执行这一条sql语句:update yong_a set b=1 where a = (控件test1填进去的数字),最好能用adodb连接
数据库是:diy 帐号:system 密码:1;小弟不才,看了两天VB连接oracle还是没弄懂,希望高手搭救!
希望能把整一个语句写下来让小弟研究研究

[解决办法]

VB code
Public CNADO As New ADODB.ConnectionPublic rs As New ADODB.RecordsetPublic rs1 As New ADODB.RecordsetDim sql As StringDim connect As StringFunction data_connection() As BooleanOn Error GoTo dataconnectionerrSet CNADO = New ADODB.ConnectionCNADO.Provider = "MSDAORA"CNADO.ConnectionTimeout = 10CNADO.CursorLocation = adUseClientCNADO.Open "DATA SOURCE=diy;", "system", "1"'CNADO.Open "DATA SOURCE=数据库;", "账号", "密码"date_connection = TrueExit Functiondataconnectionerr:   MsgBox Err.Description   Data_Connect = FalseEnd FunctionPrivate Sub Command1_Click()Call Command2_ClickEnd SubPrivate Sub Command2_Click()On Error GoTo error1:Set rs = New Recordsetsql = "" + Text1.Text + ""      rs.Open sql, CNADO, adOpenStatic      Set DataGrid1.DataSource = rs      Exit Suberror1:      MsgBox "no table"End SubPrivate Sub Form_Load()data_connectionEnd Sub 

热点排行