| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 461 人关注过本帖
标题:[求助]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
快速回复:[求助]vb求助
数据加载中...
 
   



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

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