踩到的坑:php
1.在rollout裏面關閉當前dialog 直接寫在裏面無效html
rollout floater2 "登陸"
(
label lbl_username "用戶名:" align:#left across:2
edittext txt_username "" width:100 height:20 align:#right arcoss:2
label lbl_password "密碼:" align:#left across:2
edittext txt_password "" width:100 align:#right across:2
global objectUsername = ""
global objectPassword = ""mysql
on txt_username entered txt do(
objectUsername = txt
txt_username.text = txt
DestroyDialog floater
)
on txt_password entered txt do (
objectPassword = txt
txt_password.text = txt
)
)sql
2..鏈接數據庫 沒法鏈接,總是說不能訪問數據庫
TestConn=createOLEObject "ADODB.Connection"
TestConn.Open "driver={MySQL ODBC 3.51 Driver}; server=serverName; database=databaseName;user=userName;password=password"
recordSet = createOLEObject "ADODB.Recordset"
selectString = "SELECT * from tableName where username='"+username+"' and password='"+password+"'"
recordSet.Open selectString TestConn -- Standard SQL Request in ""
recordset.GetRows()函數
解決方案:工具
問題1:將dialog的建立放到函數中去server
fn makeDialog =
(
rollout floater "登陸信息"
(
label lbl_username "用戶名:" align:#left across:2
edittext txt_username "" width:100 height:20 align:#right arcoss:2
label lbl_password "密碼:" align:#left across:2
edittext txt_password "" width:100 align:#right across:2
button btn_loginBottom "登陸" width:60 align:#center
global objectUsername = ""
global objectPassword = ""htm
on txt_username entered txt do(
objectUsername = txt
txt_username.text = txt
)
on txt_password entered txt do (
objectPassword = txt
txt_password.text = txt
)
on btn_loginBottom pressed do
(
--驗證登陸信息是否正確
result = fn_validateUser objectUsername objectPassword
print 2222
print result
print (result == "fail")
if result =="success" then (DestroyDialog floater) else (print "fail")
)
)
createdialog floater width:200 height:100
setFocus floater.txt_username
)ci
問題2:參考http://forums.cgsociety.org/archive/index.php?t-384588.html
- 根據本身的電腦(32位仍是64位)選擇安裝mysql-connector-odbc-3.51.30
- 單擊開始-控制面板-管理工具
- 雙擊數據源(ODBC)
- 單擊切換到系統DSN選項卡,單擊添加
- 雙擊MySQL ODBC 3.51 Driver,如圖2所示,填寫Data Source Name,TCP/IP Server:,User:,Password: ,Database: .點擊ok保存,肯定.