B
bedlang
Unregistered / Unconfirmed
GUEST, unregistred user!
诸位请看以下ActiveX代码:
//============================================
function TSmstar.Get_ConnectDB(var ODBC, UID, PWD: OleVariant): OleVariant;
var connDSN:string;
begin
connDSN := 'User ID=' + UID + ';Data Source=' + ODBC + ';Password=' + PWD;
try
conn.ConnectionString := connDSN;
conn.Connected := true;
result := true;
except
result := false;
end;
end;
procedure TSmstar.SetReg(var Key, Name, value: OleVariant);
var reg:TRegistry;
begin
try
reg := TRegistry.Create;
reg.RootKey := HKEY_LOCAL_MACHINE;
reg.OpenKey(Key, True);
reg.WriteString(name,value);
reg.Free;
except
end;
end;
//================以下在ASP中调用================
Set sss = Server.CreateObject("sss.Smstar")
sss.ConnectDB("smstar","sa","") '*****这行正确*****
sss.SetReg("dfdf","gh","34") '*****这一行出错*****
请大家帮帮忙!万分感谢!
//============================================
function TSmstar.Get_ConnectDB(var ODBC, UID, PWD: OleVariant): OleVariant;
var connDSN:string;
begin
connDSN := 'User ID=' + UID + ';Data Source=' + ODBC + ';Password=' + PWD;
try
conn.ConnectionString := connDSN;
conn.Connected := true;
result := true;
except
result := false;
end;
end;
procedure TSmstar.SetReg(var Key, Name, value: OleVariant);
var reg:TRegistry;
begin
try
reg := TRegistry.Create;
reg.RootKey := HKEY_LOCAL_MACHINE;
reg.OpenKey(Key, True);
reg.WriteString(name,value);
reg.Free;
except
end;
end;
//================以下在ASP中调用================
Set sss = Server.CreateObject("sss.Smstar")
sss.ConnectDB("smstar","sa","") '*****这行正确*****
sss.SetReg("dfdf","gh","34") '*****这一行出错*****
请大家帮帮忙!万分感谢!