|
本帖最后由 luyuqi 于 2009-10-1 17:01 编辑
小弟是菜鸟,想用下列方法将查询结果生成一个新表(名称为信息表),数据库链接部分没问题,接下来不会了.请指教.谢谢!
Dim conn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim sql As String
Set conn = New ADODB.Connection
conn.Open "Provider=MSDASQL;DRIVER=SQL Server; SERVER=server;DATABASE=td; UID=sa; PWD="
sql = "SELECT d.bh, d.dm FROM d;"
Set rst = New ADODB.Recordset
rst.CursorLocation = adUseClient
rst.Open sql, conn
rst.MoveFirst
'此处加入生成表的代码
rst.Close
Set rst = Nothing |
|