Search the web
Sign In
New User? Sign Up
briousers · Brio Users - Help with deploying Brio Enterprise
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
export to access table via excel (JOOLE script) - size limit?   Message List  
Reply | Forward Message #15719 of 15825 |
hi,

i am new to brio, and have solved some problems from this group - so
much thanks!

my problem now is that i have a query that i can export to an Access
table via Excel through JOOLE if the query returns anything up to
approximately 15,000 lines. anything over this, it fails to paste
the results table into the Excel sheet, and consequently the transfer
spreadsheet command will fail as there is nothing in the sheet to
transfer.

i know this query works for up to 28,000 lines, as i have
successfully exported the results table to Access - however that was
before i had included the 'GetExcelPID' and 'KillExcelPID' scripts.

any suggestions????

script file :


// call vbs script to get PID of excel instance
// the PID is stored in a file named SomeFileName.txt
// saved in the D:\ drive home directory.
//
if (gobjFSO.FileExists(gExportScripts+"\\GetExcelPID.vbs"))

Application.Shell "wscript",gExportScripts+"\\GetExcelPID.vbs");


//
//**************************************
//

// Create a new instance of Access
var oAccess= new JOOLEObject("Access.Application");
oAccess.Visible=true;

var myTableName="";
var myDbName="";
var myExcelFileName="";
var acImport = 0;
var acSpreadsheetTypeExcel9=8;

// Set table and database names

var fullpath_dir=ActiveDocument.Path;
var file_name=ActiveDocument.Name;
var directory_location;
var slash=Application.PathSeparator
var
dble_slash=Application.PathSeparator+Application.PathSeparator

directory_location = fullpath_dir.substr(0,
(fullpath_dir.length - (file_name.length + 1)))

var db_location=directory_location.substr(directory_location,
1, 2) + ":" + dble_slash

var build_string="";
for (var cntr=3; cntr<=directory_location.length-1; cntr
=cntr+1)
{
if (directory_location.charAt(cntr) != slash)
{
build_string=build_string +
directory_location.charAt(cntr);
}
else
{
db_location=db_location + build_string +
dble_slash;
build_string="";
}
}

db_location=db_location + build_string + dble_slash
+ "Bids.mdb";


myTableName= "OPG";

// add to existing database
oAccess.OpenCurrentDatabase (db_location); // to add
to existing database


// Copy the Brio data into Excel
oExcel = new JOOLEObject ("Excel.Application");
oExcel.Visible=true;

// Create a new Document
var myExcelDoc = oExcel.Workbooks.Add;
var mySheet=myExcelDoc.Worksheets.Add;
ActiveDocument.Sections["Results - OPG R'ton"].Copy();
mySheet.Cells.Item(1).Item(1).Select;
mySheet.Paste;
myExcelDoc.Save;
myExcelFileName=myExcelDoc.FullName;



// delete contents of existing table and copy excel
workbook over table.
//
// ***** NOTE Function Args in Reverse Order to Microsoft
Documentation
// Import the data into Access
oAccess.DoCmd.RunSQL("Delete * FROM OPG;");
oAccess.DoCmd.TransferSpreadsheet(-1, myExcelFileName,
myTableName, acSpreadsheetTypeExcel9, acImport);

//Close Excel Workbook
// use application.quit to close the excel window.
//oExcel.Workbooks.Close;
oExcel.Application.Quit();
oAccess.Application.Quit();

//***************************************************************


//Finally, KILL that Excel Process!!!!
if (gobjFSO.FileExists(gExportScripts+"\\KillExcelPID.vbs"))
Application.Shell
("wscript",gExportScripts+"\\KillExcelPID.vbs");

Alert("Transfer of Vizirail bid data to Bids database now complete.");





Wed Nov 5, 2008 5:37 am

bernie.storrier
Offline Offline
Send Email Send Email

Forward
Message #15719 of 15825 |
Expand Messages Author Sort by Date

hi, i am new to brio, and have solved some problems from this group - so much thanks! my problem now is that i have a query that i can export to an Access ...
bernie.storrier
Offline Send Email
Nov 5, 2008
5:37 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help