原access 数据表中ZD列后面2列是什么意思,导入到Excel后怎么出现图示的情况;为什么导出的Excel第一行没有access中的第一行,如果导出的Excel第一行有access中的第一行,需要怎么修改程序?
陌路相逢_1515503045 发表于2018-02-05 00:27
应该是权限控制开关,回头看看具体是什么东东
至于为啥没有第一行,vb中都是从8开始的,看看循环语句
不明白,可不可以说的具体点 权限控制开关是哪的,源程序如下:
Private Sub Form_Load()
Text1.Text = App.Path & "\msdb.mdb"
mycnstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\msdb.mdb;Persist Security Info=False"
Adodc1.ConnectionString = mycnstr
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "bkdd"
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer
Dim newxls As Excel.Application
Dim newbook As Excel.Workbook
Dim newsheet As Excel.Worksheet
Set newxls = CreateObject("Excel.Application") '创建excel应用程序,打开excel2000
newxls.Visible = True
Set newbook = newxls.Workbooks.Add '创建工作簿
Set newsheet = newbook.Worksheets(1) '创建工作表
If Adodc1.Recordset.EOF = False Then
For i = 0 To Adodc1.Recordset.RecordCount - 1
For j = 0 To Adodc1.Recordset.Fields.Count - 1
On Error Resume Next
DataGrid1.Row = i
DataGrid1.Col = j
newsheet.Cells(i + 1, j + 1) = DataGrid1.Text
Next j
Next i
End If
End Sub
Private Sub Command2_Click()
End
End Sub