ca143508 Posted January 16, 2008 Posted January 16, 2008 Hey Guys, I need some help developing a gui for this basic database updating app. The code I am using is listed below. I expect that when the user completes the 4 fields and clicks a submit button it would call the function and update the database. The problem is I am not too sure on how to get that done. Any help would be great. Thanks. $dbname="master" $tblname="tbl1" $fldname="Feild1" $sqlCon = ObjCreate("ADODB.Connection") $sqlCon.Open("Driver={SQL Server};Server=127.0.0.1;Database=Master;Uid=MySQLUser;Pwd=MySQLPassword;") $SQL = "SELECT * FROM tbl1" $DSN_Connect = _getfield($SQL,$dbname,$fldname) Func _getfield($_SQL,$_dbname,$_fldname) dim $_output $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open("Driver={SQL Server};Server=127.0.0.1;Database=Master;Uid=MySQLUser;Pwd=MySQLPassword;") $adoRs = ObjCreate ("ADODB.Recordset") $adoSQL = $_sql $adoRs.CursorType = 2 $adoRs.LockType = 3 $adoRs.Open($adoSql, $adoCon) $adoRS.AddNew $adoRS.Fields("Field1").Value = "InputField1" $adoRS.Fields("Field2").Value = "InputField2" $adoRS.Fields("Field3").Value = "InputField3" $adoRS.Fields("Field4").Value = "InputField4" $adoRS.Update $adoCon.Close EndFunc
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now