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

access the variant

hello
I am creating a VARIANT that stores a integer value of variable but variable is not initialize.In my code the variable are "r" and"c" where r and c are the value of row and column of a table.I am using it in a split function of Cell class of my project.The code for which i create for VARIANT is as follows and syntax of Split function are as follows.Please help me how i use this variant in my code.

The code for variant is

VARIANT v;
VariantInit(&v);
v.vt=VT_14;
V_I4(&v)=r;
VARIANT v1;
VariantInit(&v1);
v1.vt=VT_14;
V_I4(&v1)=r;


The syntax for Split function is

void Split(VARIANT *NumRows,VARIANT * NumColumns)

Then what shouild i do, please help me.
Jan 13 '09 #1
4 5942
Banfa
9,065 Expert Mod 8TB
Can you describe this function declaration

void Split(VARIANT *NumRows,VARIANT * NumColumns)

in English?
Jan 13 '09 #2
weaknessforcats
9,208 Expert Mod 8TB
This code looks fishy:
Expand|Select|Wrap|Line Numbers
  1.  
  2. VARIANT v;
  3. VariantInit(&v);
  4. v.vt=VT_14;
  5. V_I4(&v)=r;
  6.  
  7.  
I see the VARIANT v being defined. I see the VARIANT being initialized. I see the discriminator being set to VT_14, which is not correct as there is no VT_14 for a VARIANT. That should be VT_I4. But in any case I do not see the LONG being placed in the VARIANT.

Where do you set v.lval?

This code V_I4(&v)=r also looks odd. Maybe you set v.lval inside the V_I4 function but assigning r to the return of V_I4 accomplishes nothing. In any case, V_I4 is a poor name for a function since it is so close to the VARIANT discriminator enum values.
Jan 13 '09 #3
thanx for ur suggestion

I am using it and there is no problem but in the following code there was syntax problem.please tell me where is the error

VARIANT v;
VariantInit(&v);
v.vt=VT_I4;
v.intVal=r;

VARIANT v1;
VariantInit(&v1);
v1.vt=VT_I4;
v1.intVal=c;
if(cell.Split((v*),(v1*)))
{
.
.
.
}

it gives the error in if block of syntax error:')'.U have to suggest me to used lVal which is used for LONG but i m using integer and i m using intVal.so what should i do.
Jan 14 '09 #4
weaknessforcats
9,208 Expert Mod 8TB
First read the documentation on VARIANT before trying to use it. VT_I4 is for a LONG and you do use lVal.

An INT is VT_INT and there you use intVal.

A little Google is all you need:
VARIANT and VARIANTARG
Jan 14 '09 #5

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

Similar topics

3
by: Nicola | last post by:
Hi Everyone, I am new to programming and would like to know how to open an access Report from within vb 6. I am trying to write a program to organise cross stitch threads. I have found out how...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
3
by: Jorge Cecílio | last post by:
Hi! I would like to export some MS-Access reports output to pdf. However, the only possibility offered by Access (afaik) for me to export formatted output is snp (snapshot) (I use MS-Office...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
4
by: musicloverlch | last post by:
I used to be able to create PDFs, automatically save them to a file, and mail them out to people. This was on Access 97 with Windows NT. We've changed to Windows XP and Access 2003. Doesn't work...
5
by: horsetransport | last post by:
Hello, Below is what I "Know how to do" but it doesn't accomplish what I want I have table called sndmail fields that matter useremail and mailsent
1
by: gm | last post by:
Hi; I have written a database that tracks all the installation we have ever done. I have a small heating company. I have recently started keeping a directory of digital photographs of the...
0
by: jayohare | last post by:
Hello, I have code within my DB application to process credit cards through authorize.net. Ive been using the same code for several years without a problem. I have an order entry computer and...
3
by: Richard Finnigan | last post by:
Hi I was wondering if anyone could help me with this problem. I've been using VWD and my webhost ( a shared hosting package) have told me that the MSQL express files wont work on thier server so...
6
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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.