[dba-SQLServer] SQL Server 2005 Database With Visual Basic 6.0 Front-End

paul.hartland at fsmail.net paul.hartland at fsmail.net
Tue Jul 18 05:16:47 CDT 2006


To all,

We have recently installed SQL Server 2005 and I am looking at using the network login names for security on the database, I have set mine up and setup a test table called tblUsers and as a test disabled myself from updating the column password.  I have a very basic form on the front-end which will bring me back my logon name and password like below:

    Dim rs as ADODB.Recordset
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open ("SELECT * FROM tblUsers"), DEOPARA.SQLConn, adOpenDynamic, adLockOptimistic
    
    Me.Text1 = rs.Fields("Username")
    Me.Text2 = rs.Fields("Password")
and if I try to edit Text2 (got an update recordset command on the lostfocus as a test for now), it returns an error telling me I can't update this field.

What I was wondering is, when I return the recordset is there anyway of telling which field(s) if any aren't going to be updateable by the user, so I can then disable the text box, or would the best way be an error trapping routine for the update error.

Any help on this would be greatly appreciated as this is going to turn into a big internal development, when I eventually get to grips with everything.

Paul Hartland


More information about the dba-SQLServer mailing list