Caritatis

Just another WordPress.com weblog

Mail/Email merge with Word and Windows Live Mail May 11, 2012

Filed under: Uncategorized — caritatis @ 10:50 am

Yes, I use Windows Live Mail instead of Outlook.  I was trying to do a mail merge using Windows Live and it kept trying to install Outlook.  It could send email from Live, why couldn’t it merge email?  I found the answer here:  http://theapptimes.com/word-2010-how-to-perform-a-mail-merge/.  Thank you!!  It can only send a plain text email!  That’s all I really needed, so I didn’t waste all my effort setting it up.  Thank goodness!

 

Moving an alias Drupal site June 21, 2010

Filed under: Uncategorized — caritatis @ 3:28 pm

1)  Copy the files over from the original site to the new site

2)  Dump Database From Original Site

mysqldump -u -p [databasename]  >  /[path]/[databasename].sql
 
3)  Get Database from Original Site (make sure you’re in the location you want to get the file to)
sftp [your id]@[computer name]
[password]
Get the file to New Site
get [filename].sql
exit

4)  Get username & password from settings.php
more /[path]/[website]/settings.php

5)  Create Database on New Site (in MySQL) & Grant permissions
mysql -u -p
[password]
create database [databasename]
Grant permissions:
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER
ON [databasename].*
TO [user]@’localhost’
IDENTIFIED BY ‘[password]‘;
exit;

6)  Import Database to New site (command line)
mysql -u root -p -e “source /home/[your directory]/[databasename].sql” [databasename]

7)  Edit the setting.php & update the database info
cd /[path]/[website]
Edit in vi:
 vi settings.php
Find the following line and then press i to enter input mode
Change $db_url to use localhost
$db_url = ‘mysqli://[username]:[password]@localhost/[databasename]‘;

Save file
<Esc> <shift>zz
 

8)  Reset the filepaths in the database
mysql -u root -p
[password]
use [databasename]
UPDATE files SET filepath = REPLACE(filepath,’original path’,'new path’);
update node_revisions set body = replace(body,’original path’,'new path’);

update node_revisions set teaser = replace(teaser,’original path’,'new path’);
Also, run the following to see if there are any paths to fix on mini-panels (do not change database, because of checksums!!!):

select * from panels_pane where configuration like ‘%original path%’;
9) Change the File System Path on the Drupal Site:
Site Configuration -> File System

 

Use IIS7 for Coldfusion localhost June 9, 2010

Filed under: Uncategorized — caritatis @ 12:45 am

http://www.codecurry.com/2009/09/installing-coldfusion-on-iis-7.html

 

jqGrid and ColdFusion Arrays May 21, 2010

Filed under: Uncategorized — caritatis @ 1:06 pm

I just spent a lot of time over the past 2 days tying to figure out something I’d already done–passing json to jqGrid using arrays.  I just forgot (or didn’t notice before?) that you have to declare a different kind of array and can’t use the standard CF arrays.  Instead, you have to use this declaration at the top of your function:

<!— Notice the var! —>
<cfset var arrInvoices = ArrayNew(1)>

This keeps CF from adding extra row information for each array row:  {“ROWS”:{“1″:[47,”.  What I really wanted was:  {“ROWS”:[[47,.

 

JSON is cooler than I realized February 10, 2010

Filed under: JavaScript,Uncategorized — caritatis @ 9:09 pm

A JSON item

itemDetails = {
“id” : “itemShades”,
“description” : “Yoko Ono’ s sunglasses. … “,
“price” : 258.99,
“urls” : ["http://www. beatles. com/",
"http: //www. johnlennon. com/"]
}

Get JSON.Parse

Get json2.js from http://www.json.org

How to handle Dynamic JSON

function displayDetails() {
if ( request. readyState == 4) {
if (request. status == 200) {
var detailDiv = document. getElementById(“description”) ;
var itemDetails =  JSON. parse(‘ (‘ + request. responseText + ‘ ) ‘ ) ;
// Remove existing item details (if any)
var children = detailDiv. childNodes;
for (var i=children. length; i>0; i–) {
detailDiv. removeChild(children[i-1] ) ;
}
// Add new item details
for (var property in itemDetails) {
var propertyValue = itemDetails[property] ;
if (! isArray(propertyValue) ) {
var p = document. createElement(“p”) ;
p.appendChild(
document. createTextNode(property + ” : ” + propertyValue) ) ;
detailDiv. appendChild(p) ;
} else {
var p = document. createElement(“p”) ;
p.appendChild(document. createTextNode( property + “: “) ) ;
var list = document. createElement(“ul”) ;
for (var i=0; i<propertyValue. length; i++) {
var li = document. createElement(“li”) ;
li. appendChild(document. createTextNode( propertyValue[i] ) ) ;
list. appendChild(li) ;
}
detailDiv. appendChild(p) ;
detailDiv. appendChild(list) ;
}
}
}
}
}

To Dynamically determine if property is an array:

function isArray(arg) {

if (typeof arg == ‘ obj ect’ ) {

var criteria = arg.constructor. toString() . match(/array/i) ;

return (criteria ! = null) ;

}

return false;

}

AJAX Code

function createRequest() {
try {
request = new XMLHttpRequest( ) ;
} catch (tryMS) {
try {
request = new ActiveXObj ect(” Msxml2. XMLHTTP”) ;
} catch ( otherMS) {
try {
request = new ActiveXObject(“Microsoft. XMLHTTP”) ;
} catch ( failed) {
request = null;
}
}
}
return request;
}

function getActivatedObject(e) {
var obj ;
if ( ! e) {
// early version of IE
obj = window. event. srcElement;
} else if ( e. srcElement) {
// IE 7 or later
obj = e. srcElement;
} else {
// DOM Level 2 browser
obj = e. target;
}
return obj ;
}
function addEventHandler(obj , eventName, handler) {
if ( document. attachEvent) {
obj . attachEvent(“on” + eventName, handler) ;
} else if ( document. addEventListener) {
obj . addEventListener(eventName, handler, false) ;
}
}

 

CF Select with a Query February 4, 2010

Filed under: Uncategorized — caritatis @ 4:29 pm

<cfselect name=”CategoryOne”
                              query=”Categories”
                              display=”Category”
                              value=”ID”
                              selected=”#OtherQueryWithValue.CategoryOne#”
                              queryPosition=”Below”
                              required=”yes”
                              message=”Please select a Category.”>
                        <option value=”" <cfif OtherQueryWithValue.CategoryOne eq “0″>selected</cfif>> – </option>
                     </cfselect>

 

Grant Execute May 19, 2009

Filed under: Uncategorized — caritatis @ 12:36 am

/* CREATE A NEW ROLE */
CREATE ROLE db_executor

/* GRANT EXECUTE TO THE ROLE */
GRANT EXECUTE TO db_executor

Then, just assign that role to your user.  This should be standard in the setup for sql.  Not sure why they’re making you create it.  In using SQL Server from a website, you don’t want them doing anything but calling stored procs.

 

Need an Access equivalent to DTS February 23, 2009

Filed under: Uncategorized — caritatis @ 6:50 pm

Found this:

 >Firstly, we want to upsize our Access db to a bigger environment and  a large database which is SQL db  and + automate the entire process

OK, I understand THAT.  At a minimum you migrate the backend tables; Then you can use DTS to feed those tables.  

>Secondly,Once we move Querys,Macro,modules(for modules we can use DTS ActiveX script)

Now I’m lost.  If you keep the Access front end, you don’t move the queries, macros, and modules.  Some of them may be replaced by DTS, but the rest remain in the front end.

>how can we trigger Access reports to generate?

You schedule a job (using NT scheduler is easiest way).  The job starts up Access which has an AutoExec Macro.  The Autoexec macro either runs the reports (simple) or runs some code that interprets the command line arguments to figure out what you want to do (more complex)

>how SQL server can link to Access db inorder to generate reports ?

More confusion. SQL Server Reporting Services can reference an Access datasource.   But, according to you, you upsized to SQL Server, so you don’t have an Access DB any more.  Also, SQL Server can’t run Access reports, those have to be run by Access.    

>is there any way in DTS where we can create a task to go to Access db and generate report?  

I don’t know.  But it’s the long way around the block.  Let’s say you upsize to SQL Server.  So, now your tables are in the SQL Server backend.   Your Access Front End can still link to those tables and still run Access reports.  (At least for the most part.  As I explained in the previous thread, you may find that some things don’t work perfectly and need to make some adjustments.  So, do lots of testing.  But the good news–Reports should not be affected too much by upsizing).

If you want to automate your reports.  Build an Access Macro to run the reports. Name it AUTOEXEC or call if from the AUTOEXEC macro.  Create an event in the NT scheduler and start the .mdb file.  That’s all there is to it.

 

http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/accessmigration.mspx
http://sqlserverpedia.com/blog/?p=69
http://technet.microsoft.com/en-us/library/aa902657(SQL.80).aspx#sqlbac_topic2

 

 
Follow

Get every new post delivered to your Inbox.