| 发表于:2007-10-21 18:32:323楼 得分:0 |
我把我代码发上来大家研究一下 private sub form_unload(cancel as integer) dim server as string, uid as string, pwd as string, database as string, temp as string server = getinifile(sysfile, section, "a8") uid = getinifile(sysfile, section, "a6") pwd = getinifile(sysfile, section, "a7" database = getinifile(sysfile, section, "a2") connectstr = "driver={sql server};server=" & server temp = ";uid=" & uid msgbox temp '这个显示都正常 connectstr = connectstr & temp msgbox connectstr '这个显示就没连接到后面 connectstr = connectstr & temp if len(pwd) > 0 then connectstr = connectstr & ";pwd=" & pwd connectstr = connectstr + ";database=" + database msgbox (connectstr) end sub 我要的结果connectstr = "driver={sql server};server=192.168.20.5;uid=sa;pwd=****;database=hlyddd" | | |
|