以下是引用cmy2006在2013-3-6 10:16:49的发言:
set safety off
public mypath
mypath=""
mypath=getfile("xls")
if len(alltrim(mypath))=0
messagebox("你未选择任何表文件!",48,"提示")
ELSE
Import From (mypath) Type xls
lcTmpDbfName=Juststem(Dbf())
ac=Fcount("&lcTmpDbfName")
For m.lnI=1 To ac
lcStr="Alter Table "+ "&lcTmpDbfName Rename Column "+Field(m.lnI)+" To "+Evaluate(Field(m.lnI))
&lcStr.
ENDFOR
USE bsc表 EXCLUSIVE
ZAP
APPEND FROM "&lcTmpDbfName"
GO TOP
DELETE
PACK
SELECT &mypath
DELETE FILE (mypath).DBF
messagebox("数据导入成功!",48,"提示")
ENDIF
怎么总是运行到ac=Fcount("&lcTmpDbfName")提示"找不到别名",请大家帮帮忙!
ac=Fcount("&lcTmpDbfName") 应该是 ac=Fcount(lcTmpDbfName) 吧
set safety off
public mypath
mypath=""
mypath=getfile("xls")
if len(alltrim(mypath))=0
messagebox("你未选择任何表文件!",48,"提示")
ELSE
Import From (mypath) Type xls
lcTmpDbfName=Juststem(Dbf())
ac=Fcount("&lcTmpDbfName")
For m.lnI=1 To ac
lcStr="Alter Table "+ "&lcTmpDbfName Rename Column "+Field(m.lnI)+" To "+Evaluate(Field(m.lnI))
&lcStr.
ENDFOR
USE bsc表 EXCLUSIVE
ZAP
APPEND FROM "&lcTmpDbfName"
GO TOP
DELETE
PACK
SELECT &mypath
DELETE FILE (mypath).DBF
messagebox("数据导入成功!",48,"提示")
ENDIF
怎么总是运行到ac=Fcount("&lcTmpDbfName")提示"找不到别名",请大家帮帮忙!
只求每天有一丁点儿的进步就可以了