开发工具:
文件大小: 4kb
下载次数: 0
上传时间: 2012-11-30
详细说明: Dim extend_str As String Dim execl_cnn As New ADODB.Connection Dim execl_rst As New ADODB.Recordset Dim execl_count_rst As New ADODB.Recordset '纪录数量 Dim execl_field_rst As New ADODB.Recordset Dim execl_strconn As String Dim execl_strcmd As String Dim execl_count_str As String Dim insertStr As String 操作oracle数据库的记录集 Dim rst As ADODB.Recordset CommonDialog1.ShowOpen extend_str = Right(CommonDialog1.FileName, 3) If (extend_str = "xls") Then execl_cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" &a mp; _ "Data Source=" & CommonDialog1.FileName & _ ";Extended Properties=Excel 8.0;" ElseIf (extend_str = "dbf") Then execl_cnn.ConnectionString = "Provider=MSDASQL.1;Driver=Microsoft Visual Foxpro Driver;SourceType=DBF;DBQ=" & getDir (CommonDialog1.FileName) execl_cnn.Open End If If (extend_str = "xls") Then execl_strcmd = "SELECT * from `Sheet1$` " execl_count_str = "SELECT count(*) from `Sheet1$` " execl_field_rst.Open execl_count_str, execl_cnn If (execl_field_rst.Fields(0).Value = 0) Then execl_strcmd = "SELECT * from [" & getFileNoExt(getfile(CommonDialog1.FileName)) & "$] " execl_count_str = "SELECT count(*) from [" & getFileNoExt(getfile(CommonDialog1.FileName)) & "$] " End If execl_field_rst.Close ElseIf (extend_str = "dbf") Then execl_strcmd = "SELECT * from " & CommonDialog1.FileName execl_count_str = "SELECT count(*) from " & CommonDialog1.FileName End If execl_rst.Open execl_strcmd, execl_cnn execl_count_rst.Open execl_count_str, execl_cnn If (CommonDialog1.FileName <> "") Then '进度条设置 ProgressBar1.Min = 0 ProgressBar1.max = execl_count_rst.Fields(0).Value If (execl_rst.RecordCount) Then '如果有记录 If (Option1.Value) Then '如果是仪器总库 If (execl_rst.Fields.Count = 8) Then Set rst = yg_gain_table_recordset("yg_device") execl_rst.MoveFirst Do While (Not execl_rst.EOF) rst.AddNew rst.Fields(0).Value = yg_getNextId("yg_device_id") rst.Fields(1).Value = execl_rst.Fields(0).Value & "" rst.Fields(2).Value = execl_rst.Fields(1).Value & "" rst.Fields(3).Value = execl_rst.Fields(2).Value & "" rst.Fields(4).Value = execl_rst.Fields(3).Value & "" rst.Fields(5).Value = execl_rst.Fields(4).Value & "" rst.Fields(6).Value = execl_rst.Fields(5).Value & "" rst.Fields(7).Value = execl_rst.Fields(6).Value & "" rst.Fields(8).Value = execl_rst.Fields(7).Value & "" rst.Update execl_rst.MoveNext ProgressBar1.Value = ProgressBar1.Value + 1 DoEvents Loop yg_free_recordset rst Else MsgBox "结构不一致" Exit Sub End If End If If (Option2.Value) Then '如果是外借仪器 If (execl_rst.Fields.Count = 12) Then Set rst = yg_gain_table_recordset("yg_out_device") execl_rst.MoveFirst Do While (Not execl_rst.EOF) rst.AddNew rst.Fields(0).Value = yg_getNextId("yg_out_device_id") rst.Fields(1).Value = execl_rst.Fields(0).Value & "" rst.Fields(2).Value = execl_rst.Fields(1).Value & "" rst.Fields(3).Value = execl_rst.Fields(2).Value & "" rst.Fields(4).Value = execl_rst.Fields(3).Value & "" rst.Fields(5).Value = execl_rst.Fields(4).Value & "" rst.Fields(6).Value = execl_rst.Fields(5).Value & "" rst.Fields(7).Value = execl_rst.Fields(6).Value & "" rst.Fields(8).Value = execl_rst.Fields(7).Value & "" rst.Fields(9).Value = execl_rst.Fields(8).Value & "" rst.Fields(10).Value = execl_rst.Fields(9).Value & "" rst.Fields(11).Value = execl_rst.Fields(10).Value & "" rst.Fields(12).Value = execl_rst.Fields(11).Value & "" rst.Update execl_rst.MoveNext ProgressBar1.Value = ProgressBar1.Value + 1 DoEvents Loop yg_free_recordset rst Else MsgBox "结构不一致" Exit Sub End If End If ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.