H happycyp Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-13 #3 connc:='Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDBatabase Password=mypass;Data Source=%sDB/Client.mdb;Persist Security Info=true'; //带密码<br>sFilePath:=ExtractFilePath(Application.ExeName);<br> try<br> //本地数据库连接<br> ADOConnLocal.Connected := false;<br> ADOConnLocal.ConnectionString:='';<br> ADOConnLocal.ConnectionString:=format(connc,[sFilePath]);<br> ADOConnLocal.Connected := true;<br> except<br> Application.Terminate;<br> end;<br>动态连接数据库,不知道你要的动态连接是不是这个。
connc:='Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDBatabase Password=mypass;Data Source=%sDB/Client.mdb;Persist Security Info=true'; //带密码<br>sFilePath:=ExtractFilePath(Application.ExeName);<br> try<br> //本地数据库连接<br> ADOConnLocal.Connected := false;<br> ADOConnLocal.ConnectionString:='';<br> ADOConnLocal.ConnectionString:=format(connc,[sFilePath]);<br> ADOConnLocal.Connected := true;<br> except<br> Application.Terminate;<br> end;<br>动态连接数据库,不知道你要的动态连接是不是这个。
H happycyp Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-13 #5 File | New | Others <br>选择 DLL Wizard 点OK.<br>即可,<br>里面怎么写,网上有很多源码可以参考。
T tianliangle2003 Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-13 #7 根据向导建立一个dll工程,然后给你一个例子,就是判断指定字符串最后字符是否为/,如果不是添加,然后返回。<br>library testdll;<br>uses<br> SysUtils,<br> Classes;<br>Function Mystring(schar)char;<br>var<br> st:string;<br>begin<br> st:=strpas(s);<br> if st[length(s)]<>'/' then<br> st:=st+'/';<br>result:=pchar(st);<br>end;<br>exports<br> Mystring;<br><br>begin<br>end.<br><br>//调用<br>Function Mystring(schar)char;external 'testdll.dll';<br>edit2.Text :=strpas( mystring(pchar(edit1.Text )));
根据向导建立一个dll工程,然后给你一个例子,就是判断指定字符串最后字符是否为/,如果不是添加,然后返回。<br>library testdll;<br>uses<br> SysUtils,<br> Classes;<br>Function Mystring(schar)char;<br>var<br> st:string;<br>begin<br> st:=strpas(s);<br> if st[length(s)]<>'/' then<br> st:=st+'/';<br>result:=pchar(st);<br>end;<br>exports<br> Mystring;<br><br>begin<br>end.<br><br>//调用<br>Function Mystring(schar)char;external 'testdll.dll';<br>edit2.Text :=strpas( mystring(pchar(edit1.Text )));