| | |
select statement error
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
Hi all... please help me with this code... i hv retrieved the id of the employee from the login n stored it as a lable in my form- logid but now with respect to that i want to get the employee name... please help very urgent!!
the error msg shown is "object variable or with block variable not set."
please help its very urgent!
thanx!
-smile4evr!
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim rs As adodb.Recordset Dim getname As String getname = "SELECT E_name FROM Employee_Details WHERE E_ID ='" & logid.Caption & "'" rs.Open getname, CN logname.Caption = rs.Fields(0)
the error msg shown is "object variable or with block variable not set."
please help its very urgent!
thanx!
-smile4evr!
There are a few points that could cause error:
- change to - make sure that CN is not nothing eg. you do have a valid connection object
- your query may return empty recordset. Haven't dealed with these for a long time but check that is not nothing. I mean that rs is not nothing.
- change
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim rs As adodb.Recordset
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim rs As New adodb.Recordset
- your query may return empty recordset. Haven't dealed with these for a long time but check that
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
rs.Fields(0)
Teme64 @ Windows Developer Blog
![]() |
Similar Threads
- Error Retrieving Single Data Using ExecuteScalar Method (VB.NET)
- Keep getting 'Missing Return Statement' error (Java)
- Runtime Error (Visual Basic 4 / 5 / 6)
- insert into sql select statement (Visual Basic 4 / 5 / 6)
- join in select statement (Visual Basic 4 / 5 / 6)
- syntax error in FROM clause (Java)
- No Error, No Insert: ASP to Access (ASP)
- Hi,Need help on sql select statement structure (MS SQL)
- Help with syntax error (ASP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Help in creating a link table in MS-Access dynamically using VB 6.0
- Next Thread: Help in Scrabble
Views: 769 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






