| 发表于:2007-11-27 17:21:13 楼主 |
拜托!拜托!虽然有点长,但本人真的很着急,感谢感谢感谢!!!! public function EXECutesql(byval sql as string, msgstring as string) as adodb.recordset dim cnn as adodb.connection dim rst as adodb.recordset dim stokens() as string on error goto EXECutesql_error stokens = split(sql) set cnn = new adodb.connection cnn.open connectstring if instr("insert,delete,update", ucase$(stokens(0))) then cnn.EXECute sql msgstring = stokens(0) & "query successful" else set rst = new adodb.recordset rst.open trim$(sql), cnn, adopendeyset, adlockoptimistic rst.movelast 'get recordcount set EXECutesql = rst msgstring = "查询到" & rst.recordcount & "条记录" end if EXECutesql_exit: set rst = nothing set cnn = nothing exit function EXECutesql_error: msgstring = "查询错误:" & err.description resume EXECutesql_exit end function public function connectstring() as string connectstring = "filedsn=student_info.dsn;uid=student_id;pwd=" end function public function testtxt(txt as string) as boolean if trim(txt) = "" then testtxt = false else testtst = true end if end function sub main() dim flogin as new frmlogin frmlogin.show vbmodal if not flogin.ok then 'login failed so exit app end end if unload frmlogin set fmainform = new frmmain fmainform.show end sub public username as string 其中sub main以黄色显示,flogin.ok中的.ok以蓝色显示 改来改去不知道,请各位高手赐教,万分感谢!!!!!!!!!! |
|
|
|
|