473,395 Members | 1,891 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,395 software developers and data experts.

Type Conversion in Win2k and XP

i have the following snippet of code for getting a list of SQL Servers

Dim sqlNameList As SQLDMO.NameList

Dim x As Integer

'Filling Servers Name

sqlNameList = sqlApp.ListAvailableSQLServers

For x = 1 To sqlNameList.Count
cbo_Server.Items.Add(UCase(sqlNameList.Item(x)))
Next

this all runs fine on XP but when you try and run it on Win2k i get an error becuase the combo box expects a string or ordinal, so to get round this i had to do a type conversion. but i was just wondering why i needed to do this on Win2k and not XP?

For x = 1 To sqlNameList.Count

str_Server = CType(sqlNameList.Item(x), String)
cbo_Server.Items.Add(UCase(str_Server))

Next

Cheers,
Craig

Nov 21 '05 #1
2 875
Hi,

My guess is that option strict in turned on in the win 2000 machine.
Please post your messages in the future in text not everyone can read the
messages when they are in richtext format.

http://msdn.microsoft.com/library/de...tionStrict.asp
Ken
-----------------------
"Craig G" <cr**********@yarrasoftware.com> wrote in message
news:eP**************@tk2msftngp13.phx.gbl...
i have the following snippet of code for getting a list of SQL Servers

Dim sqlNameList As SQLDMO.NameList
Dim x As Integer
'Filling Servers Name
sqlNameList = sqlApp.ListAvailableSQLServers
For x = 1 To sqlNameList.Count
cbo_Server.Items.Add(UCase(sqlNameList.Item(x)))
Next

this all runs fine on XP but when you try and run it on Win2k i get an error
becuase the combo box expects a string or ordinal, so to get round this i
had to do a type conversion. but i was just wondering why i needed to do
this on Win2k and not XP?
For x = 1 To sqlNameList.Count
str_Server = CType(sqlNameList.Item(x), String)
cbo_Server.Items.Add(UCase(str_Server))
Next

Cheers,
Craig
Nov 21 '05 #2
no cant be that either, option strict on the project itself is turned off.

the Win2k & XP machines that im running it on are test pc's, so only have
the OS & .NET 1.1 framework on them

sorry bout the richtext!

Craig
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:eZ*************@TK2MSFTNGP09.phx.gbl...
Hi,

My guess is that option strict in turned on in the win 2000 machine. Please post your messages in the future in text not everyone can read the
messages when they are in richtext format.

http://msdn.microsoft.com/library/de...tionStrict.asp

Ken
-----------------------
"Craig G" <cr**********@yarrasoftware.com> wrote in message
news:eP**************@tk2msftngp13.phx.gbl...
i have the following snippet of code for getting a list of SQL Servers

Dim sqlNameList As SQLDMO.NameList
Dim x As Integer
'Filling Servers Name
sqlNameList = sqlApp.ListAvailableSQLServers
For x = 1 To sqlNameList.Count
cbo_Server.Items.Add(UCase(sqlNameList.Item(x)))
Next

this all runs fine on XP but when you try and run it on Win2k i get an error becuase the combo box expects a string or ordinal, so to get round this i
had to do a type conversion. but i was just wondering why i needed to do
this on Win2k and not XP?
For x = 1 To sqlNameList.Count
str_Server = CType(sqlNameList.Item(x), String)
cbo_Server.Items.Add(UCase(str_Server))
Next

Cheers,
Craig

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bbxrider | last post by:
win2k adv server/ iis5.0/vb6.0/ado and/or odbc connections on client machine i have an mdb on win2k adv server machine and want internet read/write to it from both a non-windows, red hat, webserver...
26
by: David W. Fenton | last post by:
A client is panicking about their large Access application, which has been running smoothly with 100s of thousands of records for quite some time. They have a big project in the next year that will...
7
by: Madhu Gopinathan | last post by:
Hi, I hope this is the right forum for this question. I am extending ICollection to create a Collection Type (say MyCollection) wherein I can control the types of objects being added to the...
16
by: Enekajmer | last post by:
Hi, 1 int main() 2 { 3 float a = 17.5; 4 printf("%d\n", a); 5 printf("%d\n", *(int *)&a); 6 return 0; 7 }
2
by: Martin v. Löwis | last post by:
I've been working on PEP 353 for some time now. Please comment, in particular if you are using 64-bit systems. Regards, Martin PEP: 353 Title: Using ssize_t as the index type Version:...
1
by: lovecreatesbeauty | last post by:
There is a warning/(error? I remember it is an error for line 10 on some compilers before. At least on g++, it is an error.) for line 10. I first read a similar example from `Expert C Programming...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
4
by: zaeminkr | last post by:
I got a good answer here I have still confusing part. I have two very simple classes class DRect { private : double x0, y0, x1, y1; public : DRect(double a, double b, double c, double d) :...
8
by: Smithers | last post by:
Are there any important differences between the following two ways to convert to a type?... where 'important differences' means something more profound than a simple syntax preference of the...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.