|
-
Oct 2nd, 2010, 10:44 PM
#1
Thread Starter
Member
accesiing data from database...
i want to access the data from database..i already connected (.mdb database )in my vb. i want to accesss data to text box,combo box from the database...etc plz any one tell the code
-
Oct 3rd, 2010, 03:07 AM
#2
Re: accesiing data from database...
Thread moved from the 'CodeBank VB6' forum (which is for you to post working code examples, not questions) to the 'Database Development' forum
As you have already been told in another thread, there is a good tutorial at the start of the "Classic VB: ADO" section of our Database Development FAQs/Tutorials (at the top of this forum)
When you have already been given a tutorial, it is rather rude to ask us to spend our time re-writing it specifically for you. Even if somebody was willing to do it, it wont be as good as the one you have been told to look as, because they wont put in anywhere near as much effort as they would for a tutorial that will be read by thousands of people.
Go thru the tutorial, and if you can't solve your issue after that, ask for help with specific issues that you don't understand.
-
Oct 3rd, 2010, 05:50 AM
#3
Thread Starter
Member
Re: accesiing data from database...
i saw this if u know the coding plz post it........
-
Oct 3rd, 2010, 06:04 AM
#4
Thread Starter
Member
Re: accesiing data from database...
if u know coding plz tell..........
-
Oct 3rd, 2010, 06:05 AM
#5
Re: accesiing data from database...
I have already told you - the code (with explanations) is in the tutorial, why are you asking us to write it again? 
In addition to that, do not bump your threads. For some of the reasons, see this. People will read your thread (and hopefully reply) when they get the time to do so.
-
Oct 3rd, 2010, 07:47 AM
#6
Thread Starter
Member
Code:
Private Sub Form_Load()
con.ConnectionString = "Provider=Microsoft.Jet.oledb.4.0;Data Source=" & App.Path & " \AirLines.mdb"
con.Open
rs.Open "Select * from Flight_Details order by SrNo", con, adOpenDynamic
Filling
Values
end sub
----------------------------------------------------------
Sub Values()
Dim i
If rs2.State = 1 Then rs2.Close
rs2.Open "Select max(SrNo) from Flight_Details ", con
i = rs2.Fields(0) + 1
If rs.EOF = True Or rs.BOF = True Then
If txtsr.Text < i Then
MsgBox "Class Not Found", vbInformation, "Airlines"
cmbclasscode.SetFocus
Else
End If
Exit Sub
End If
txtsr.Text = rs.Fields(4)
txtcode.Text = rs.Fields(0)
txtfare.Text = rs.Fields(2)
txtseats.Text = rs.Fields(3)
If rs1.State = 1 Then rs1.Close
rs1.Open "Select Airline_name from Airlines_Master where Aircode ='" & Mid$(rs.Fields(0), 1, 2) & "'"
txtflight.Text = UCase(rs1.Fields(0))
cmbnum.Text = Mid$(rs.Fields(0), 3, 4)
cmbcode.Text = Mid$(rs.Fields(0), 1, 2)
If rs1.State = 1 Then rs1.Close
rs1.Open "Select ClassName from Class_Master where ClassCode='" & rs.Fields(1) & "'", con
If rs1.EOF = True Or rs1.BOF = True Then
MsgBox "No Records To Display", vbInformation, "Airlines"
Exit Sub
End If
cmbclasscode.Text = UCase(rs1.Fields(0))
i written this code but it shows some error....
like sub or function not defined this is the errror i got during compilation.....
Last edited by si_the_geek; Oct 3rd, 2010 at 08:19 AM.
Reason: was needlessly spread across 3 posts
-
Oct 3rd, 2010, 08:21 AM
#7
Re: accesiing data from database...
Which line did the error highlight?
-
Oct 3rd, 2010, 08:25 AM
#8
Thread Starter
Member
Re: accesiing data from database...
-
Oct 3rd, 2010, 08:26 AM
#9
Thread Starter
Member
Re: accesiing data from database...
sub or function not defined this is the errror i got during compilation
-
Oct 3rd, 2010, 08:32 AM
#10
Re: accesiing data from database...
Please stop posting multiple replies in a short space of time. Instead you should think a bit more carefully before you submit the first one, so that it includes everything you want to tell us.
You need to be more specific about which line it is, because the first line is Private Sub Form_Load() , which could not generate that error.
-
Oct 3rd, 2010, 08:52 AM
#11
Thread Starter
Member
Re: accesiing data from database...
sub or function not defined this is the error message .
-
Oct 3rd, 2010, 09:00 AM
#12
Re: accesiing data from database...
We already know that, you have told us 3 times now.
What we don't know (and I have asked twice already) is which line it occurred on.
-
Oct 3rd, 2010, 11:03 AM
#13
Thread Starter
Member
Re: accesiing data from database...
when i compiled yellow colour is highlighted in the first line.
-
Oct 3rd, 2010, 06:47 PM
#14
Re: accesiing data from database...
 Originally Posted by crazylith
sub or function not defined this is the error message .
Well, that error means you are missing something! If you are talking about this line:
vb Code:
con.ConnectionString = "Provider=Microsoft.Jet.oledb.4.0;Data Source=" & App.Path & " \AirLines.mdb"
Make sure AirLines.mdb is in the correct folder (in this case the same one as your exe will be located in) and that you have installed Access on the target computer.
With this line:
It is complaining because the sub you are calling isn't in your project.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
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
|