print an MS-Access table
-
:((Hi All, I want to get the printout of an access table but when i open it & print it, i only get the first record printed.What may be wrong? Here are the two lines for opening & printing that i am using: oDoCmd.OpenTable(_variant_t("recipe"),0,1); oDoCmd.PrintOut(1,_variant_t("1"),_variant_z("1"),1L,_variant_t("1"),_variant_t("1")); May be the problem is because whenever the table is opened its first record is already selected by default.perhaps, all the records need to be selected. How can i do that. i am using vc++ 6.0 & ms-access 2000. Please Help. it is urgent. Regards, Ankush Mehta
-
:((Hi All, I want to get the printout of an access table but when i open it & print it, i only get the first record printed.What may be wrong? Here are the two lines for opening & printing that i am using: oDoCmd.OpenTable(_variant_t("recipe"),0,1); oDoCmd.PrintOut(1,_variant_t("1"),_variant_z("1"),1L,_variant_t("1"),_variant_t("1")); May be the problem is because whenever the table is opened its first record is already selected by default.perhaps, all the records need to be selected. How can i do that. i am using vc++ 6.0 & ms-access 2000. Please Help. it is urgent. Regards, Ankush Mehta
What is DoCmd ? I mean what type of object is it Vikas Amin Embin Technology Bombay vikas.amin@embin.com
-
What is DoCmd ? I mean what type of object is it Vikas Amin Embin Technology Bombay vikas.amin@embin.com
it is used in access automation.see object model documentation for automating ms office. hierarchical object model is used for office automation. see msdn for details. Regards, Ankush Mehta Ankush Mehta, Dewsoft Solutions, Mumbai
-
:((Hi All, I want to get the printout of an access table but when i open it & print it, i only get the first record printed.What may be wrong? Here are the two lines for opening & printing that i am using: oDoCmd.OpenTable(_variant_t("recipe"),0,1); oDoCmd.PrintOut(1,_variant_t("1"),_variant_z("1"),1L,_variant_t("1"),_variant_t("1")); May be the problem is because whenever the table is opened its first record is already selected by default.perhaps, all the records need to be selected. How can i do that. i am using vc++ 6.0 & ms-access 2000. Please Help. it is urgent. Regards, Ankush Mehta
Ankush Mehta wrote:
oDoCmd.PrintOut(1,_variant_t("1"),_variant_z("1"),1L,_variant_t("1"),_variant_t("1"));
Your arguments are wrong for the Printout command. acPrintAll == 0 acSelection == 1 acPages == 2 BTW, there shouldn’t be any need to recast (all though I’m not completely sure about that) as all of the arguments are integers. Good luck...
ZeePain! wrote:
This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
-
Ankush Mehta wrote:
oDoCmd.PrintOut(1,_variant_t("1"),_variant_z("1"),1L,_variant_t("1"),_variant_t("1"));
Your arguments are wrong for the Printout command. acPrintAll == 0 acSelection == 1 acPages == 2 BTW, there shouldn’t be any need to recast (all though I’m not completely sure about that) as all of the arguments are integers. Good luck...
ZeePain! wrote:
This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
sfdougl wrote:
oDoCmd.PrintOut(1,_variant_t("1"),_variant_z("1"),1L,_variant_t("1"),_variant_t("1"));
Thanks, First argument must be zero(print all).But as per VBA documentation second & third arguments(from page, to page) should be omitted.This doesn't work out in VC++.Error is- error C2660: 'PrintOut' : function does not take 4 parameters. We need to type cast since these are of type variant in vc++. Any idea buddy 4 d solution.Can u possibly suggest me how to have the number of tables and their names in ms access database. Thanks in anticipation, Ankush Mehta
-
sfdougl wrote:
oDoCmd.PrintOut(1,_variant_t("1"),_variant_z("1"),1L,_variant_t("1"),_variant_t("1"));
Thanks, First argument must be zero(print all).But as per VBA documentation second & third arguments(from page, to page) should be omitted.This doesn't work out in VC++.Error is- error C2660: 'PrintOut' : function does not take 4 parameters. We need to type cast since these are of type variant in vc++. Any idea buddy 4 d solution.Can u possibly suggest me how to have the number of tables and their names in ms access database. Thanks in anticipation, Ankush Mehta
Ankush Mehta wrote:
First argument must be zero(print all).
Yup that’s why I mentioned it; your first argument is 1 which is print selection, in other words the currently selected record. Change that argument to a 0.
Ankush Mehta wrote:
per VBA documentation second & third arguments(from page, to page) should be omitted
Im no where near a complier to test this but if 1 is causing an error try -1.
Ankush Mehta wrote:
Can u possibly suggest me how to have the number of tables and their names in ms access database.
You can query Acces for tables i.e. SELECT MSysObjects.Name FROM MSysObjects WHERE (((MSysObjects.Name) Like "Table Name" or simply SELECT MSysObjects.Name FROM MSysObjects Hows that?
ZeePain! wrote:
This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
-
Ankush Mehta wrote:
First argument must be zero(print all).
Yup that’s why I mentioned it; your first argument is 1 which is print selection, in other words the currently selected record. Change that argument to a 0.
Ankush Mehta wrote:
per VBA documentation second & third arguments(from page, to page) should be omitted
Im no where near a complier to test this but if 1 is causing an error try -1.
Ankush Mehta wrote:
Can u possibly suggest me how to have the number of tables and their names in ms access database.
You can query Acces for tables i.e. SELECT MSysObjects.Name FROM MSysObjects WHERE (((MSysObjects.Name) Like "Table Name" or simply SELECT MSysObjects.Name FROM MSysObjects Hows that?
ZeePain! wrote:
This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
How can i query that using vc++?Please suggest. Let me restate the problem. I want to print an entire ms access table using vc++.Unfortunately, the code works fine for vb(in which if first argument of printout is 0, there is no need for second & third argument).The same thing in vc++ is not supported, it asks for all six arguments DoCmd.PrintOut [printrange][, pagefrom] [,pageto][, printquality][, copies][, collatecopies]::(( Ankush Mehta
-
How can i query that using vc++?Please suggest. Let me restate the problem. I want to print an entire ms access table using vc++.Unfortunately, the code works fine for vb(in which if first argument of printout is 0, there is no need for second & third argument).The same thing in vc++ is not supported, it asks for all six arguments DoCmd.PrintOut [printrange][, pagefrom] [,pageto][, printquality][, copies][, collatecopies]::(( Ankush Mehta
Ankush Mehta wrote:
Let me restate the problem. I want to print an entire ms access table using vc++.
Does your app have to use office automaiton? If so have you looked at CAccessReports class[^] Alternatively I have always wanted to use this library Report Generator[^]
ZeePain! wrote:
This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.