請高手幫幫忙:
vba中有下面一段**,為什麼總在
rsdata.open ssql, sconnect, adopenforwardonly, adlockreadonly, adcmdtext
處提示"m jet 找不到物件[生產計畫$plan_area],請確定物件是否存在,並正確的寫出它的名稱和路徑",
private sub c_click()
dim adocnnection as adodb.connection
dim rsdata as adodb.recordset
dim sconnect as string
dim ssql as string
dim spath as string
spath = thisworkbook.path
if right$(spath, 1) <> "/" then spath = spath & "/"
'microsoft oledb
sconnect = "provider=microsoft.jet.oledb.4.0;" & _
"data source=" & spath & "plan.xls;" & _
"extended properties=excel 8.0;"
ssql = "select * from [生產計畫$plan_area] order by 機號 desc, 模具編號 desc"
set adocnnection = new adodb.connection
adocnnection.open sconnect
set rsdata = new adodb.recordset
rsdata.activeconnection = adocnnection
rsdata.open ssql, sconnect, adopenforwardonly, adlockreadonly, adcmdtext
if not rsdata.eof then
生產計畫.range("a1:ax600").copyfromrecordset rsdata
else
msgbox "沒有排序資料。", vbcritical
end if
rsdata.close
set rsdata = nothing
end sub
ADO操作儲存過程(VB)
dim adoconnaction as new adodb.connaction dim adocommand as new adodb.command dim adorecordset as new adodb,recordset dim strconnaction as string 資料庫連...
利用ADO操作Excel檔案
今天花時間研究了一下ado操作excel檔案的問題,跟大家分享一下 首先利用excel2003建立了乙個名為demo.xls的檔案,內容如下 name agety 12 tzl15 然後開啟vc,建立乙個命令列應用程式。然後如一般的ado程式一樣編寫相應 只是注意開啟資料庫的 如下寫 m pconn...
VC 利用ADO操作Excel
把excel當做資料庫來操作,步驟如下 1 在stdafx.h中加入 import c program files common files system ado msado15.dll no namespace rename eof adoeof connectionptr pcon ex cst...