|
-
Feb 19th, 2007, 10:59 AM
#1
Thread Starter
Lively Member
table is empty
what will i do if the table has no entry and i will open it..
here's my code
VB Code:
Private Sub MDIForm_Load()
tbAcademicYear.Open "select * from tbacademicyear", cn, adOpenDynamic, adLockOptimistic
If tbAcademicYear.Fields(1) = Null Then
Exit Sub
Else
Set tbAcademicYear = Nothing
AY = "select * from tbacademicyear where Status like '" & "Open" & "'"
tbAcademicYear.Open AY, cn, adOpenDynamic, adLockOptimistic
StatusBar1.Panels(10) = tbAcademicYear.Fields(0)
End If
end Sub
-
Feb 19th, 2007, 11:03 AM
#2
Re: table is empty
 Originally Posted by mheiy
what will i do if the table has no entry and i will open it..
What do you need to do if it is empty?
-
Feb 19th, 2007, 11:06 AM
#3
Re: table is empty
VB Code:
Private Sub MDIForm_Load()
Dim tbAcademicYear As ADODB.Recordset
Set tbAcademicYear = New ADODB.Recordset
AY = "select * from tbacademicyear where Status like '" & "Open" & "'"
tbAcademicYear.Open AY, cn, adOpenDynamic, adLockOptimistic
If Not tbAcademicYear.EOF Then
StatusBar1.Panels(10) = tbAcademicYear.Fields(0)
End If
Set tbAcademicYear = Nothing
End Sub
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Feb 19th, 2007, 11:14 AM
#4
Thread Starter
Lively Member
table is empty
what will i do if the table has no entry and i will open it..
here's my code
VB Code:
Private Sub MDIForm_Load()
tbAcademicYear.Open "select * from tbacademicyear", cn, adOpenDynamic, adLockOptimistic
If tbAcademicYear.Fields(1) = Null Then
Exit Sub
Else
Set tbAcademicYear = Nothing
AY = "select * from tbacademicyear where Status like '" & "Open" & "'"
tbAcademicYear.Open AY, cn, adOpenDynamic, adLockOptimistic
StatusBar1.Panels(10) = tbAcademicYear.Fields(0)
End If
end Sub
-
Feb 19th, 2007, 11:23 AM
#5
Re: table is empty
Please do not create duplicate threads.
-
Feb 19th, 2007, 11:27 AM
#6
Re: table is empty
 Originally Posted by TheBigB
Please do not create duplicate threads.
Duplicate threads merged.
Please heed this advice and do not create duplicate threads for the same question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|