将excel数据导入 Access 问题 - VB / 基础类
用VB程序中将excel的文件放在和工程同一个文件夹中,导入时没有错误,但在别的目录下导入就会出现错误
提示: 主关键字重复(这个判断我在程序中加了,在和ACCESS同一目录下时没出现错误)
CommonDialog1.FileName = ""
'CommonDialog1.flags = vbofnfilemustexist
CommonDialog1.Filter = "All file|*.*|(*.xls)|*.xls"
CommonDialog1.FilterIndex = 2
CommonDialog1.DialogTitle = "导入文件"
CommonDialog1.Action = 1
If CommonDialog1.FileName = "" Then
' X = MsgBox("没有这个文件", 37, "提示")
Else
Dim oConn As New ADODB.Connection
'连接Exce
' On Error Resume Next
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= " & CommonDialog1.FileName & ";" & "Extended Properties=""Excel 8.0;"""
'oConn.Execute ("insert into [;database=f:\登记项目\zgda.mdb].个人基本资料1(ID,fld1,fld2) Select * from [Sheet1$]" & "where ID not in (select ID from [;database=zgda.mdb].个人基本资料1)")
oConn.Execute ("insert into [;database=" & app.path&"\zgda.mdb].个人基本资料1(ID,fld1,fld2) Select *
相关问答:
我想把word另存为xml之后,用vb读取这个xml的内容,请问如何实现?
dim f as integer
dim b() as byte
dim s as string
dim L as long
f=freefile()
open "abc.xml" for binary access read as #f
......
Private Sub Command1_Click()
Dim MyString() As String
Open "a.xml" For Binary As #1 ' 打开刚创建的文件。
ReDim MyString(LOF(1) - 1)
Put #1, , MyRecord ' 读入所有字符到变量中 ......
dim a as string,b as string,c as string
a="工程编号,单位工程名称,分部工程编号"
b="单位工程名称"
c="单位"
怎么才能判断出a字符串中存在b字符串,而不存在c字符串
看看i ......
form1中有text1-8, 和command1
text8中为程序代码(生成窗体为form2(已做好))
单击command1后将text2中的代码生成EXE到d:\ 并且text1-7分别对应
产品名 公司名 合法版权 合法商标 文件描述 注释 标题
......
用VB编程读取短信,得到一大堆unicode编码,请教如何转换成文本
例如:读取短信后(华为900C或TC35i),串口得到如下数据:
+CMGL: 17,"REC UNREAD","8615007557713",,"10/03/30,09:37:15+32&qu ......