标题:[求助]vb求助
只看楼主
powerlong
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2005-10-22
 问题点数:0 回复次数:2 
[求助]vb求助

帮我看看 有什么问题 谢谢了~登陆sql 有问题!(提示Refresh 有问题)

窗体1
Private Sub CmbClientType_Click()
Adodc1.ConnectionString = "driver={SQL Server};server=" + Trim(Server) + ";uid=" + Trim(User) + ";pwd=" + Trim(Password) + ";database=ERP"
If CmbClientType.Text = "供应商" Then
Adodc1.RecordSource = "select BusinessmanID as 客户ID,BusinessmanName as 客户名称,Country as 国家,Province as 省份,City as 城市,Address as 地址,Linkman as 联系人,Telephone as 电话,Fax as 传真 from Businessman "

Else
Adodc1.RecordSource = "select CustomerID as 客户ID,CustomerName as 客户名称,Country as 国家,Province as 省份,City as 城市,Address as 地址,Linkman as 联系人,Telephone as 电话,Fax as 传真 from Customer "
End If
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
TxtClientID.Text = ""
TxtClient.Text = ""
TxtLinkman.Text = ""
End Sub


窗体2

Private Sub Refresh_Busi()
Adodc1.ConnectionString = "driver={SQL Server};server=" + Trim(Server) + ";uid=" + Trim(User) + ";pwd=" + Trim(Password) + ";database=ERP"
Adodc1.RecordSource = "select * from Business "
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
LblModify.Enabled = False
LblDelete.Enabled = False
Else
LblModify.Enabled = True
LblDelete.Enabled = True
End If
End Sub

搜索更多相关主题的帖子: sql database 联系人 server 供应商 
2006-05-14 14:45
libing0254
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-3-23
得分:0 

你是用控件连接的还是代码连接的?

如果用代码就在工程里应用一下数据库的连接控件;如果用控件就在数据源里添加SQL选项

2006-05-14 15:22
powerlong
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2005-10-22
得分:0 
代码 具体怎么做
2006-05-14 16:10



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-64110-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.108487 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved