473,385 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

visual basic

8
while without wend error
Oct 10 '07 #1
8 1267
jrtox
89
while without wend error

Used this Format
Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim i as integer
  3. i = 0
  4.  
  5. While i < 5 
  6.  
  7. 'Display here
  8.  
  9. i = i + 1
  10. Wend
  11.  
  12.  
Regards
Phils Ervin
Oct 10 '07 #2
debasisdas
8,127 Expert 4TB
while without wend error
Kindly post the details of the error that you are facing.
Oct 10 '07 #3
chans
8
I am a beginner for VB. i am writing a code which has to display details of employee from database. hav a look at my code...

Private Sub Combo1_click()
Combo1.AddItem ("1233")
Combo1.AddItem ("1234")
Combo1.AddItem ("3343")
End Sub




Private Sub Form_Load()

Dim adoRecordset As ADODB.Recordset
Dim db As New ADODB.Connection
Dim mDatabaseName As String
Dim mDBserverName As String
mDatabaseName = "chandru"
mDBserverName = "(local)"
db.Connectionstring = "Driver={SQL Server};Provider=MSDASQL.1;DATABASE=" & mDatabaseName & ";uid=sa;pwd=vms;Server=" & mDBserverName & ";"
Set adoRecordset = New ADODB.Recordset
adoRecordset.Open "select name from employee", db.Connectionstring


If (Combo1 = "ssn") Then
Set Text1.DataSource = adoRecordset
Text1.DataField = "name"

Set Text2.DataSource = adoRecordset
Text2.DataField = "age"

Set Text3.DataSource = adoRecordset
Text3.DataField = "dept"


End If

End Sub



if i use form load for combo box it gives ambigous error....i want to add command button also plz giv ur suggestion plz
Oct 10 '07 #4
debasisdas
8,127 Expert 4TB
adoRecordset.Open "select name from employee", db.Connectionstring


If (Combo1 = "ssn") Then
Set Text1.DataSource = adoRecordset
Text1.DataField = "name"

Set Text2.DataSource = adoRecordset
Text2.DataField = "age"

Set Text3.DataSource = adoRecordset
Text3.DataField = "dept"

End If
End Sub
In the recorset open ,you are selecting only the name from the table.
then how your DataField is age and dept for text2 and text3 respectively.
Oct 10 '07 #5
chans
8
In the recorset open ,you are selecting only the name from the table.
then how your DataField is age and dept for text2 and text3 respectively.
i hav to print all these from from database how to do that?
Oct 10 '07 #6
chans
8
i hav to print all these from from database how to do that?
when i click on command button on giving ssn it has to retrive all info from employee table
Oct 10 '07 #7
chans
8
when i click on command button on giving ssn it has to retrive all info from employee table
adoRecordset.Open "select name from employee", db.Connectionstring
adoRecordset.Open "select age from employee", db.Connectionstring
adoRecordset.Open "select dept from employee", db.Connectionstring

If (Combo1 = "ssn") Then
Set Text1.DataSource = adoRecordset
Text1.DataField = "name"

Set Text2.DataSource = adoRecordset
Text2.DataField = "age"

Set Text3.DataSource = adoRecordset
Text3.DataField = "dept"

End If

is this ok now sir
Oct 10 '07 #8
jrtox
89
when i click on command button on giving ssn it has to retrive all info from employee table

Hello,
http://www.thescripts.com/forum/thread718154.html
go to this and download my attachment, maybe it could help for your lesson.
Study the program.

its simple.

Regards
Phils Ervin
Oct 10 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: pix | last post by:
Hello, I would like to start learning Visual Basic, and I was wondering if there are any recomendations to any ebooks, or actual books for that matter. I have my eye on this book by John Smiley,...
2
by: AK | last post by:
I don't want any part of the previous discussion on Visual Basic versus Visual Basic.Net. My query is about using Visual Basic for Applications; and whether it is better to use Visual Basic 6 or...
2
by: Ralph | last post by:
I used to have Visual Basic .net std. 2003 installed on WinXP SP1A. But I found it too hard to upgrade WinXP to SP2. Now, I do have WinXP SP2 installed, but I am having problems installing...
2
by: frossberg | last post by:
Hello! I tried to install the Visual Basic.NET Resource Kit (http://msdn.microsoft.com/vbasic/vbrkit/) but obviously something went very wrong and now it sems impossible both to repair and to...
5
by: Microsoft | last post by:
Hi, I have Visual Basic .net 2003 (Standard Edition) & SQL Server 2000 Developer Edition. When trying to create a connection in the server explorer from the .net IDE I get a number of problems;...
4
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a...
97
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in...
4
by: Chris Asaipillai | last post by:
Hi there My compay has a number of Visual Basic 6 applications which are front endeed onto either SQL Server or Microsoft Access databases. Now we are in process of planning to re-write these...
11
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I have seen the terms Visual Basic 2005 and VB.NET. It seems that sometimes they seem to be referring to the same thing but sometimes they are not. I also run into terms like VB9 and VB10.
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.