C#转化成VBA语句
try
{
OleDbCommand cmd4 = new OleDbCommand("", conn1);
string sql4 = @"select * from 各级杆塔对应参数";
cmd4.CommandText = sql4;
OleDbDataAdapter adp4 = new OleDbDataAdapter("", conn1);
adp4.SelectCommand.CommandText = sql4;
adp4.Fill(ds1, "各级杆塔对应参数");
dataGridView4.DataSource = ds1.Tables["各级杆塔对应参数"].DefaultView;
------解决方案--------------------dim sql4 as string="select * from 各级杆塔对应参数"
Dim adp as new OleDbDataAdapter(sql4, conn1)
dim ds1 as new dataset
adp.fill(ds1,"各级杆塔对应参数")
dataGridView4.DataSource = ds1.Tables("各级杆塔对应参数").DefaultView
------解决方案--------------------你的conn1不会没写吧
------解决方案--------------------Dim adp as new OleDbDataAdapter(sql4, conn1)
-->
如果你说的是VBA..那么需要这样修改
Dim adp as OleDbDataAdapter
ser adp = new OleDbDataAdapter(sql4, conn1)
如果你说的是VB.NET,那么这句话是没有问题的.
------解决方案--------------------ser adp = new OleDbDataAdapter(sql4, conn1)
--> SET adp = new OleDbDataAdapter(sql4, conn1)