DJJWP
Posts: 77
|
| Posted: 11/16/2006, 7:04 PM |
|
My objective it to click an update button in the row and update that row only with the current UserID and Date/time. I'm using MySQL and ASP on IIS.
This is what I tryed to create from examples in custom code for the button's Client onclick event.
Dim Connection
Set Connection = New clsDBNetOps
Connection.Open
Connection.Execute("UPDATE tbl_task_mgr SET updateby = CCGetUserID(),lastupdate=Now() WHERE Pkey=Pkey.value")
Connection.Close
Set Connection = Nothing
I can not get it to do anything!! 
Any help would be VERY welcome!
_________________
Network Operations Rule |
 |
 |
marcwolf
Posts: 361
|
| Posted: 11/20/2006, 7:36 PM |
|
Hi DJJWP.
This is a very tricky one and there are several ways you can get around it.
Now - with the update button - I take it this is on a Row by Row basis and you can only do this on the clients side. I'll explain a server side solution later.
If you look at the generated HTML you will see that each control in an Editiable Grid's row has a suffix of _xx where xx is the row id.
Now what you need to do (and I'll uses abstacts here) is to pass to a Javascript function an object that is on that row. Lets say that it is a textbox called Name_3
The Javascript function can take that object and extract its NAME property. Then we can search for the '_' and then next part will give up the row number :>
Once we have this we can work on that row. If there is a field there called UserId_3 then we can do this
Get Row. Take String of "UserID" and add "_3" ro get UserId_3. Now we can just find that object on the page and update it.
I generally find it is an excellent idea to use the ID field during design time to hold the objects name as you can use the getobjectbyif Javascript function.
If you want to send this information to the server and update the underlying record then you can use the above to get the row and any fields on that row you require and then use AJAX or some other background server commincations stratigy to call an ASP page to do that for you.
Hope this gives you some pinters. I'd include code but I am flat out at the moment.
Take Care
Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
|
 |
 |
|