How To View The Datatypes Of Every Columns
Hi all
anyone here, knows how to view the data types, i'm using vb 6 front and oracle as back end. What i want to do is this : Examples: i have table EMP: columns= Fname,age,D_Date:
i want to view like this:
Column_name | DataTypes | Null Fname | varchar2(30) | not null Age | number(2) | D_Date | Date |
Is this possible?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
2 Columns In List View:
i ahve a list view box, when i click the add button, i need to be able to add:
add.text in the first column
desc.text in the second column
but i can only get add.text in the first column.......
Ordering Columns In A List View
I know I can use the ascending and descending properties to order the first column in a list view, but how can I order the other columns as well?
Listview Columns In List View
I am trying to use Listview to import data from an Access table and I only want to use the list view not the list report. The data imports OK and populates the list OK into (in this case with the quantity of data imported) 4 columns.
Trouble is, all the data is truncated and I can find no way of setting the column widths as you can in the normal list box. I do not have any sub-items, just a single list so I do not need to set up any column headers.
Removing Columns From Datasheet View
Hi all, please help!
I have a subform (in datasheet view) that has to show/hide different columns under different contexts.
I tried
mytextbox.visible = false
where mytextbox is a textbox in the subform. This hides the textbox in Form View, but doesn't do the trick in Datasheet View.
I also tried
mytextbox.ColumnHidden = true
This method hides the column in the datasheet, but the column is still in the datasheet. So the user can bring the hidden column back by resizing the column (dragging the column header).
It there any way to truely hide/delete/remove a column from a datasheet view???? I've looked everywhere on web, but in vein.
Any help would be greatly appreciated! Thanks in advance!!!
-- kothreat@yahoo.com --
Moving Columns On A Listview (Report View)
I want to programmatically set the Position of the columns in a list view.
This is an "after thought" so I am trying to do it on already loaded listviews.
I see from a little experimentation that I can easily move the column headers by simply changing the .position property.
But that does not bring over the data for that column. (Just the header)
Do I have to manually move the data or there an easier way?
(By "manually move the data" I mean set up a temp array, copy the column's data, update new column after moving other column into original col number)
Regards,
List View Select - Multiple Columns
I have a listview control with two columns...
1. File Name
2. Extension
When I selected the file I return the file name, but if i want to retrieve the properties regarding the file i need the extension which is in column 2...
This will get the information in column 1 (File Name)
Set objFile = objFSO.GetFile(DirList.List(DirList.ListIndex) & "" & lstFileList.SelectedItem.Text)
How do I get it so that it gets the info in column 1 and adds the info of column 2 to that string? i.e.
file name extension
mydoc doc
myvideo avi
myemail eml
i want it so that when i click on mydoc the string becomes... mydoc.doc, any ideas? thanks
- gabe
How Do I Hide/unhide Columns In A List View?
I want the user to choose the columns for a specified output though all the columns will be filled
with data , i want to display only those columns which the user selects.Currently i make the width
of the hidden column as - 0 but that the user can just keep his mouse on the header and drag to
see the hidden column. How do I actually hide it???
Sorting On DATE Columns In MS List View
Does anybody know how to get this to work?
The listview seems only capable of accepting strings as it's items so dates have to be converted to text and therefore are sorted as text.
How can I get around this?
Freeze The Columns Of List View Control
Hi Gurus,
I want to freeze the columns of a Listview control in Report view mode. Is there any property of List View or any other code example to show me how to prevent the columns to be resized by the user?
Help me plz, it is really necessary.
Waqas...
List View Find Text By Corrosponding Columns
Hi, i have a list view with 2 coumns and it retrieve information from a server and it contains different amounts of information at once.
What i need to do is locate in the first column of the listview anything containing
the index "hostname" then go retrieve the hostname which would be in the next column in the exact row. So it looks like this
Column 1 - Column 2
=====================
ip add - 192.168.blahblah
hostname - TheTestName
i want to retrieve "TheTestName" by finding the column "hostname" but i have no ideas how to achieve this. If anyone could help me out that would be great.
2 Qs : Timer And How Do I Hide/unhide Columns In A List View?
hi,
2 questions
For a listview, I want the user to choose the columns for a specified output though all the columns will be filled with data , i want to display only those columns which the user selects(Like we have it in windows explorer). Currently I make the width of the hidden column as - 0 but that the user can just keep his mouse on the header and drag to see the hidden column. How do I actually hide it???
Second question:
I have just recently find out that one cannot set the interval time of a timer for than 65000 millisecs that is apporx a minute. How do I set the interval of a timer for more than a minute say 3 minutes?
Thanks.
How To Sort Columns In List View -- Just Like Windows Explorer
Hi,
I am using ListView Control.. I want to sort the listview on a particular column when user selects it. Is there any direct way of doing this.. And can I set colors to rows in a Listview control.. Like I have a situation where I want alternate colours to be displayed.. Is it possible
Regards
Surya Prakash
Datatypes
Hello All
I am trying to create an Access2000 table using ADO.
I am not sure of the DataTypes. Is there a list somewhere?
eg
char(len)
etc. etc.
Thanks
DataTypes
A couple of queries concerning data types. What datatypes would I Dim a variable as if I wanted to load a picture into it. Also what datatype would I use to store a color when using the Common Dialoge control.
Thanks
Datatypes
how to create a datatype with functions in it?
VIsualPenguin
Mixing Datatypes
i need to be able to have a variable hold string and byte data.. like..
image1 = "imagename:" & <random string of bytes here>
is that at all possible?
Changing Datatypes
Hi, I wonder if anybody can tell me how to change the datatype of a field in Access. I've tried to run sql to alter the table, but I remember you can only add or delete fields using sql. And so I can't actually get it to update an existing field which contains data already. Anybody help?
Variable Datatypes
Hi all
I'm using webqueries and suchlike to import some data. No problem.
One piece of data can be an array or a single number depending on which record I look at.
Is there a way I can examine this variable, let's call it 'varChanging' to discover it's type?
Thanks in advance,
Aljrob
Field Datatypes In ADO
I am in the process of converting a VB program which uses DAO to read Access DB records to ADO. I noticed that the Datatypes of the Fields are different when you deal with ADO. I am using 202 (adVarWChar) in ADO to deal with a String datatype in DAO which is 10. If anyone is familiar with it , please give me some suggestions.
I heard that creating a Database programmatically using ADOX is useful only for Access2000 database not for highter versions. Can someone clarify this info for me??
Changing DataTypes
I am accessing a database with over 32768 records, and I am using the ListView control to display them. However I think the number of items you can have a list is the max of an integer. Anyway I can change this to Long?
Column Datatypes
Hey,
need a bit of help regarding ADO
I'm using the connection objects .openschema method to return the columns within a specific table.
i.e.
VB Code:
Set objRec = objConn.OpenSchema(adSchemaColumns, _Array(Empty, Empty, "tbl_asset", Empty)) With objRec While Not .EOF 'add the fields Me.cbo_fields.AddItem ![COLUMN_NAME] .MoveNext Wend .CloseEnd With
Is there a way of reading in the columns datatype at the same time?
Any help would be as usual much appreciated!
tom
Datatypes And Limits For Each
As i havent got MSDN, can anyone tell me all the available VB6 datatypes and the range the fields can hold please? Ive seen it somewhere on the web but now i cant seem to find it.
Thanks a lot doodles
Testing DataTypes
Is there a function for testing the actual datatype of an object? I have an application that should run a certain procedure whenever an Outlook.MailItem is opened, by passing the Inspector.CurrentItem into the procedure as a parameter. However, if the user actually opened a read-receipt, this causes an error because the Inspector.CurrentItem is now an Outlook.ReportItem instead.
Is there a way of saying something like:
VB Code:
If DataType(Inspector.CurrentItem) = Outlook.MailItem Then
TIA...
Image Datatypes
I am using microsoft SQL server 7 and noticed that one of the possible datatypes of a field is 'Image'. I have created a table with one of the fields set to this 'Image' type and can't figure out a way to set or view it. I have tried to edit the value in the enterprise manager but It says I can't change it. I have also messed around in VB trying to set it, but with no results. I used a dataenvironment designer and dragged the field onto a form and the default bound control was a textbox. Hmm. Anyone have any experience with this?
Problem With Different Sql Datatypes
hi gurus
i have been working on two different databases nd has to retrive some record by comparing two fields of each of database
the problem is that datatype of field in one database is int.
where as datatype of field of other database is numeric.
i used the convert function also but still problem remains as it is
Code:
If rsino.State = 1 Then rsino.Close: Set rsino = Nothing
rsino.Open ("Select distinct Filed1 from db1.dbo.tb1 where db1.dbo.tb1.Dated='2005-11-18' "), cn
While rsino.EOF = False
If rsrno.State = 1 Then rsrno.Close: Set rsrno = Nothing
rsrno.Open "Select Field2 from tb2 where Field2=" & rsino.Fields(0) & " AND Dated='2005-11-18' order by Field2", cn
If rsino.EOF = True Or IsNull(rsino.Fields(0)) = True Then
lstino.AddItem rsino.Fields(0)
rsino.MoveNext
Else
rsino.MoveNext
End If
Wend
any solution to this problem ?????????????
Plz dont blame for spelling mistake !!!!!!!!!!!!!!!!!!!!!!1
Quick Question About Datatypes, Please Help
I am moving a bunch of controls around in an Access report using VBA, and I wanted to generalize
Code:
With Me.txt_inv_no
.Visible = True
.Top = 510
.Left = 10695
End With
as
Call SetProperty("txt_inv_no","Top",510)
Call SetProperty("txt_inv_no", "Left",10695)
Theoretically, I want it to perform along the lines of this, which I think makes sense, although I understand it could get a little messy
Code:
Sub SetProperty(propertyParent As ???, propertyName As ???, propertyValue As ???)
Me.propertyParent.propertyName = propertyValue
End Sub
And eventually, I'd like to get to something along the lines of:
Call SetProperties("txt_inv_no","Top",510,"Left",10695)
but I can figure that one out once I understand what is needed to do the first one.
On a related note, I already have working this function which takes an array of controls and sets the visibility on or off
Code:
Sub SetVisibility(VisibleOrNot As Boolean, ControlArray As Variant)
Dim intI As Integer
For intI = 0 To UBound(ControlArray)
ControlArray(intI).Visible = VisibleOrNot
Next intI
End Sub
But I would now like to pass an array of properties about one control instead of changing one property on an array of controls.
Thank you all for your help.
User Defined Datatypes
I am writing a program that connections through ODBC to a server. I am trying to use the following dim statement
Dim db as Database
where database is a user defined type. I am not sure how i am suppose to handle a user defined type. I aware of the Type...End Type function, but I am unclear as to what goes inside that function.
Any help would be great!!
Sunshine
ORA-00932: Inconsistent Datatypes
Hi , im facing some problems building up a query that involves an operation on
'long' datatype ...This is the query
select count(*) from pkg where GRAPHICS like '#512%';
and this is the error that i get
ORA-00932: inconsistent datatypes
How do i change the query so that i will get the same output?
Thankx in advancee...
Easy VB6 Question - Datatypes
how do you check a datatype of an unknown value?
for example if i was using the Excel object, and looking at a specific cell, how can i check if its a number or not?
thanks.
VB && Numeric/Single DataTypes
I have a SQL table that stores (among other things) phone numbers. I have the phone number field declared as a numeric data type with a precision of 10 and a scale of 0. I am using a stored procedure to insert phone numbers into the table based on values I pass it in VB. I have the stored procedure parameter declared as a numeric(10, 0) and the value I pass to that parameter using ADO & VB is a Single datatype. However, I keep getting the following error:
"The precision is invalid"
I can't figure out why because the number being passed is only 10 digits long therefore a precision of 10 is all I should need. Does anyone have any thoughts?
Getting Corresponding Datatype For Win32api Datatypes In VB
I want to know what is the datatype to be used to get a handle for window.
win32 api function have their own datatype.
eg. SC_HANDLE,LPCSTR,TChar
In general i want to know where or how can i get corresponding VB datatype and how to use that in VB coding in calling win32 api function.
Thanx in advance.
Division By Zero, Am I Messing Up Datatypes?
Hey guys,
I am trying to get the persentage of occurrence of a certain word in a column of a grid with respect to total number of rows. Well, I assume the total number of rows is grid1.rows , but seems that whener I want to divide the number of words by this amount a division by zero error occurs.
Code:with Grid1
Dim TNW As Long
for i=1 to .rows 'there is a fixed row that's why started from 1
If .TextMatrix(i,5) = "mail" then
TNW = TNW +1
.textmatrix(i,6) = TNW / (.rows - 1) *100
End If
next i
End With
By doing so I always get 0 in the cell next to word I am looking for.
First of all I was wondering whether there is a built in function for Percent. Secondly, how can I add % sign to the number without changing its datatype. Cause I'm going to need them later for calculations.And lastly, how can I make the result to be shown in %25.3 like format (one floating digit ignoring less significant digits)
Edited by - lucky_duke on 4/7/2004 8:52:16 PM
Working With Double Datatypes
I have just run into a strange error, and wanted to know if anyone has encountered it, and if so... how to get around it.
Try this
Code:
Private Sub Command1_Click()
Dim num As Double
Dim inc As Double
Dim i1 As Integer
Dim i2 As Integer
Dim i3 As Integer
num = 304.8
num = num / 25.4
i1 = num 12
inc = 0
inc = CDbl(i1 * 12)
MsgBox num = 12
num = num - inc
i2 = num
num = num - CDbl(i2)
i3 = num / 0.0625
MsgBox i1 & vbCrLf & i2 & vbCrLf & i3
End Sub
Paste this code on the click event of a button, then step through the code
at the Msgbox line, the value of num is 12, but when compared to 12... they are not equal
furthermore, the line immediately after the Msgbox returns a very bizzar result.
Am I doing something wrong? Is this a bug?
2 DataTypes In A Single Field! Is That Possible?
I am working on MS Access and Visual Basic 6
My Project requires that One of the fields in my database table should Accept two kinds of values............
VIZ. Number or Currency
Depending upon the kind of Value present in the record I can process that record.....But is it really possible for me to do so...
If Not then kindly suggest me some other ways!!
Helping gesture would be greatly appreciated!!
Edited by - neerajs on 12/16/2004 12:43:50 AM
The Returncode Of Datatypes Changed
I have a big problem with return values of recordsets.
I am connecting in my VB6 code via "Microsoft ODBC for Oracle" driver to an oracle database.
I installed my application on several clients and always the returncode of the recordset was 139
i retrieve the value with the following statement:
rs.fields(0).type
this returns me the value 139.
i have installed the application now on a new server but here i get the problem that the value isn't 139 anymore but 5
i have a test system but i am not possible to reproduce this "error"
I have used diffrent types of MDAC but none could reproduce the error.
I checked the characterset of the server and of the oracle client.
They are the same on the test system and on the "problem server"
Can anyone help me with this subject?
Thanks in advance
Wim
Edited by - swoop145 on 10/29/2004 7:03:59 AM
Stop Assuming Datatypes!!!
Arghh this is so frustrating.
The following peice of code populates a dataset from a tab delimited text file;
MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; data source=" & xFile.DirectoryName & "; Extended Properties=""text;FMT=Delimited""")
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from " & xFile.FullName, MyConnection)
MyCommand.Fill(DS)
MyConnection.Close()
Nice and simple.
I have a column called Item Number. The first 30 rows of 'Item Number' are actual numbers. The remaining 40 contain non-numeric characters.
The problem is that in the dataset that is returned, the 'Item Number' column is numeric, despite the fact that it clearly is not numeric because it contains non-numeric characters. It just seems to look at the first value and assume it from there.
This results in the remaining 40 rows that contain non-numeric values for 'Item Number' return null.
What a crock. Can anyone PLEASE help! I just want every field to be returned as varchar/text.
Validating DataTypes In Access From VB
Hi guys!
Just wondering,
if i have this line in my code:
addTitleRS.Fields("Title") = txtTitle.Text
where title is a field in my database table with a text datatype,
how do i write code to validate this if the user types in data that isn't text
(ie letters A-Z).
I want the program to check what the user has typed in against what the datatype is for that field in the table, then output an error message accordingly and return the user to the text box again so they can type in the correct data.
Thanks guys!
Koddy
Excel Object Datatypes
I have a little utility that converts between Excel worksheets and Access tables. The program runs fine but I was hoping someone might know of a way that I can find out programmatically what the datatype is for the Excel column currently being read and how to set Excel column datatypes when creating a worksheet from a table. At the moment I use a table that holds all the schema information needed for the conversion but this isn't very generic in it's application.
Thanks, Reedie
Edited by - just_reedie on 12/12/2005 3:11:12 AM
NEED HELP WITH SQL DATATYPES AND RICH TEXT **HELP**
I need to save an article in article form to a database. I currently am using ntext as the column datatype. When I create a recordset and display the results.... all i get is just a string of text and nothing in paragraph form. How can I save something to sql and keep its form. PLEASE HELP
Returning Datatypes From C/C++ Function Call
I am stumped by the following problem:
'my decleared datastructure
Type datastruct
element1 as byte
elemetn2 as integer
element3 as string
end
'Declared variables
Dim ds as datastruct
Dim size as Long
Here's what I'd like to do:
'assign the return value to the ds variable
size = Len(datastruct) 'get the size of the data structure
ds = OSacquire(size) 'allocate memory for the data structure and return the address
'of the allocated memory and assign it to ds
'note that OSacquire is a C/C++ dll that in C/C++ returns a far *
'in my VB declaration I've declared OSacquire to return as Long
'Hence I get mismatched type errors when compiling in VB
'fill in the elements into the ds datastructure upon successful memory allocation
ds.element1 = 3
ds.element2 = 4
ds.element3 = "Testing123"
I'm simply trying to return the pointer from the OSacquire function call and assign it to the datastruct type.
Any ideas?
Thanks.
Function Overloading, Same Argument Datatypes
This is more a general, best practices question, but I'm implementing it vb.
I'm wondering if anyone knows the best way to overload a subroutine using arguments having the same datatype.
For example, let's say I'm instantiating a collections class called Notes. I want to pass in either a note ID to retrieve a single note or a customer ID to retrieve all notes for a specific customer. Both arguments are type Int23.
What I've done was create a public enumerated datatype, ReportType, with members ByNoteID and ByCustomerID. Then the subroutine signature would then resemble:
New(aID as Int32, aReportType as ReportType)
To me, this seems clean enough, but quickly becomes ugly once I overload it another half dozen times using different argument datatypes like dates. So the constructor above could then look like:
New(aID as Int32, aStartDate as DateTime, aEndDate as DateTime, aReportType as ReportType*)
*Assume I've added a couple more 'ByDate' ReportType members for the new constructor.
Then when instantiating the collection class the developer could mistakenly use a 'ByDate' ReportType value in the wrong constructor.
Any suggestions?
Difference Between IPicture And StdPicture Datatypes
I have been working on a control that uses xp-style graphics. Up to this point I took the lazy way out and used a hidden picbox to contain the source picture...now I want to just get rid of the picbox completely and do everything through code.
I am new to all this GDI graphic 'stuff' (although I know a heck of a lot more than I did a week ago!). When would I want to use an IPicture type instead of a stdPicture? Just by reading through MSDN it looks like the IPicture is the basic framework under all the OLE picture types, but is there any advantage to using it directly? I am just wondering because I have seen different examples using different types and I can't figure out what the heck is different between the two
God Bless America
Linked List Using User Defined Datatypes
i'm a third year engineering student..
i was asked to solve the water jug problem using vb by my teacher...
i tried using user defined data types to create a tree for the different states
this was the structure i used:-
private type node
gallon1 as integer
gallon2 as integer
children(4) as node
end type
it is giving me a runtime error at the statement "children(4) as node" saying that "CIRCULAR DEPENDENCIES BETWEEN MODULES"
can any body help me out...
i cant use class modules 'coz arrays can't be made public in class modules...
plz help me some one....plz...plz.... i just need to know the correct node structure
Datatypes: Bitoperations With Floating Point Numbers
Hello,
from my point of view, I'm having a really tiny problem, but I am not able to solve it by myself. Is it really that hard?
My final goal is to be able to split 32bit floating point variables (as Sinlgle) binary into 4 seperate bytes (which is necessary to work with a given transmission protocol). Therefor I am trying to read and write single bits in a floating point variable (e.g. Single).
I already succeeded with 32bit variables of the type Long. So my problem would already be solved, if you can help me to write the 32 bits of the 32bit Single variable bitwise into the 32 bits of a 32bit Long variable.
Code:
dim s as Single
'dim s as Long
Dim bit(0 To 30) As Boolean
s = 12.34
's = 12
For j = 0 To 30
bit(j) = CBool(s And 2 ^ j)
Next j
This code works fine for the commented line, when the variable s is of type Long. When s is of type Single, VB automaticly casts the 12.34 to an Integervalue of 12.
So how can I split (and recombine) the 32bit Singlevalue into Bytes (8bit)?
Thanks in advance for your effort, Parity
Storing User Defined Datatypes In A Collection
can this be done? seems to me that you can only store predefined datatypes or variants in a collection (or dictionary).
i have a datatype and i want to store it in a dictionary or collection so that i can easily add, remove, or search for elements.
is there a workaround for this? i have found code to implement a linked list but for what I need this for it's not worth the extra implementation effort.
Change Sqlserver Datatypes With Visualbasic @ Runtime
Want to go through a loop of all of the Field names in a particular table (Customer)
I want to check:
If a field has the datatype of a float(8), change it to datatype NVARCHAR(255)
with VB at Runtime
I am denormalizing a table and need all of the numeric fields to become text upon a conversion.
example, a numeric '1' with be changed to the word 'active'
when everything is converted.
---DENORMALIZE
Thanks in advance
Jeff
Accepting Multiple Datatypes In A Class Property?
Hello
I have a class with a GET property which accepts data. The data I send to this property can be of differing datatypes.
I've read that polymorphism isn't possible in VB6. Are there any clean ways of emulating polymorphism in VB6 so that I can accept different datatypes.
I do not want to use a Variant in the property if there is a better solution.
Please remember that the class object is within another class object, so I would like to keep it within the one class if possible to keep my project tide.
Thanks.
Writing User-Defined Datatypes To Disk
I have a class file that is basically a data record with all of the necessary property lets and property gets required for access. I also have methods for opening, closing, and writing the data record. The data record is a user-defined type.
What I need to do, is write this user-defined type to a disk file (not a database). The situation is something like this (simplified, as my actual record consists of several layers of user-defined types):
Public class datarecord
option explicit
private type record
field1 as string * 10
field2 as string * 5
end type
dim theRecord as record
Property Lets, Property Gets, (etc. etc.)....
Public Function WriteIt() as Integer
'* This is where my problem is
End Function
What I want to do in the WriteIt function is to write theRecord as a whole group to a text file on disk that I have opened as Append. Right now I am doing the following:
Print #fnum, field1;field2;
Does anyone know how I can do this?
Also, along the same lines, I have an Initialize subroutine in this class to fill all fields on the record with spaces. I would like to move spaces to theRecord instead of to each individual field. Can anyone tell me how this is done as well? And what if some of the items within the record eventually are integers, longs, etc?
|