raghx_2000
asked on
About Columns
Hi !
I want some function which is equivalent to SQLNumResultCols( ) in VB, since iam using ADODB.
Also i want to count the Column Length of a table, how can i do ?
Can someone help me with a piece of code please.... would be much helpful..
Regards
I want some function which is equivalent to SQLNumResultCols( ) in VB, since iam using ADODB.
Also i want to count the Column Length of a table, how can i do ?
Can someone help me with a piece of code please.... would be much helpful..
Regards
objRs.Fields.count is also preferable in this way.
ASKER
I think some mistake here !
I dont want to count columns, i want to count the length of each column in a table.
Ex: if i have a columns like this in table XXX then
Column name Datatype Lenght
Name VArchar 12
Id Numeric 6
Then i must count the length....
How .... ?
any code sample will do....
I dont want to count columns, i want to count the length of each column in a table.
Ex: if i have a columns like this in table XXX then
Column name Datatype Lenght
Name VArchar 12
Id Numeric 6
Then i must count the length....
How .... ?
any code sample will do....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dim objRs As New ADODB.Recordset
Dim objCmd As New ADODB.Command
Dim objConn As New ADODB.Connection
objConn.Open strDbConnectionString
objCmd.CommandText = strSQL
objCmd.CommandType = adCmdText
Set oCmd.ActiveConnection = objConn
ObjRs.Open oCmd
MethodName = objRs.GetRows
dim i as integer
for i = 0 to uBound(MethodName)
'do what you want with your array data in here such as count the number of columns
next
objRs.Close
objConn.Close
Set objRs= Nothing
Set objCmd= Nothing
Set objConn= Nothing