#12002/3/12 22:53:15
aw中配置SQL数据源
方法:写注册表。
相关Ucd/u32:Budapi.u32(这里我是用Budapi做的示范,用其他写注册表的也可。)
具体语句如下:
userip:="SQL服务器地址"
WinDir := baSysFolder( "system" )
baWriteRegString("Software\\ODBC\\odbc.ini\\ODBC Data Sources","testsql","SQL Server","HKEY_LOCAL_MACHINE")--testsql 处为你的数据源名字
baWriteRegString("Software\\ODBC\\odbc.ini\\testsql","Driver",WinDir^"sqlsrv32.dll","HKEY_LOCAL_MACHINE")
baWriteRegString("Software\\ODBC\\odbc.ini\\testsql", "Server",userip,"HKEY_LOCAL_MACHINE")
baWriteRegString("Software\\ODBC\\odbc.ini\\testsql", "Database","test","HKEY_LOCAL_MACHINE")--test 为Sql 数据库名
baWriteRegString("Software\\ODBC\\odbc.ini\\testsql", "LastUser","sa","HKEY_LOCAL_MACHINE")--sa 为登陆数据库名
baWriteRegString("Software\\Microsoft\\MSSQLServer\\Client\\ConnectTo",userip,"DBMSSOCN,"^userip^",1433","HKEY_LOCAL_MACHINE")