当前位置:主页>销售管理软件> 列表

请问高手,我的程序在手提电脑上运行时,数据库连接不稳定,怎 找销售软件破解版

销售管理软件版1楼: 请问高手,我的程序在手提电脑上运行时,数据库连接不稳定,怎么解决?
有时能连上有时不能.在台式机器上很好.
有时候甚至还电源或重启,在连接时怎么也练不上,谢谢
请高手指教
连接数据库时我的配置文件中有,ip,数据库名和用户名(密码空)

2楼: 你看看是不是网线的问题
先保证网络通畅
在开始,运行CMD
然后ping IP地址 -t
看看怎么样 如财务软件的好处

3楼: ping一下会不会丢包.如果是网络问题,就把你的无线上网卡扔了.

4楼: 对不起,我没有把问题说清楚,我的程序时单机版,访问本地数据库,你看看时怎么回事
谢谢你

5楼: 你笔记本该换了。

6楼: :(
你是通过Dsn数据源连接的吗?尝试一下直接连接.参考下面代码.


unit Unit1;
interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB, ComObj, Grids;
type
TForm1 = class(TForm)
Button1: TButton;
StringGrid1: TStringGrid;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
var AConnection,ARecordSet:variant;
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var i:Integer;
begin
i := 0;
ARecordSet:=CreateOleObject(''ADODB.RecordSet'');
ARecordSet.open( ''Select * from userinfo'',AConnection,3,3);
StringGrid1.RowCount := ARecordSet.RecordCount+1;
StringGrid1.ColCount := 2;
while not ARecordSet.eof do begin
StringGrid1.Cells[0,i]:= ARecordSet.Fields[''name''].Value;
StringGrid1.Cells[1,i]:= ARecordSet.Fields[''pass''].Value;
i := i+1;
ARecordSet.movenext;
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
AConnection:=createoleobject(''ADODB.Connection'');
AConnection.Open(''Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;Persist Security Info=False'');
end;

end.

销售管理软件版7楼: 什么数据库?

8楼: 简单,把无线网卡关了就可以了

9楼: 首先谢谢大家的支持!


这是源代码,其中config文件中有:
server_ip=127.0.0.1
user_name=sa
db_name=keyanchu
我有的时sql2000个人版数据库,
var
FileName2: string;
Fn: TStrings;
server_ip: string;
db_server_name:string;
user_name:string;
password:string;
ip_config:TConfig_Form;
db_name:string;
path:string;
begin
Fn := TStringList.Create;
path:=getcurrentdir();
FileName2 := path+''\config.inf'';
if not FileExists(FileName2) then
begin
showmessage(''没有发现配置文件'');
ip_config:=TConfig_Form.Create(Self);
ip_config.ShowModal;
//close;
end
else
begin
fn.LoadFromFile(FileName2);
server_ip:=fn.Values[''server_ip''];
db_server_name:=fn.Values[''db_server_name''];
user_name:=fn.Values[''user_name''];
password:=fn.Values[''password''];
db_name:=fn.Values[''db_name''];
Fn.Free;
try
Data_Module1.adoconnection1.close;


Data_Module1.adoconnection1.ConnectionString:=''Provider=SQLOLEDB.1;Password="''+password+''";Persist Security Info=True;User ID=''+user_name+'';Initi'' +
''al Catalog=''+db_name+'';Data Source=''+server_ip+''\''+db_server_name;
Data_Module1.adoconnection1.Open;
edit1.SetFocus;
except
begin
showmessage(''联接数据库出错,请设置连接'');
ip_config:=TConfig_Form.Create(Self);
ip_config.ShowModal;
end;
end;
end;
end;

10楼: 好长一段啊,估计没几个人能耐心看完,我倒是耐心的看完了,但是没找不出问题.

11楼: 也不是很常呀
就是那关键的几句
大家有没有遇到过这个问题?

12楼: server_ip=127.0.0.1 如销售软件破解版

13楼: 要不你把127.0.0.1换成机器名试试看.

销售管理软件版14楼: 我知道了
我测试成功了
除了
ip外在加上数据库服务器名就可以了

15楼: 呵呵.那么就是我的答案正确啦,给分.

16楼: 靠,这贴子0分...我晕啊..楼主太不厚道了.