Category: Web Building

SQL Server: Clone a database with all its objects

A previous post covered the steps to copy table structure and data to a new or existing database.

To copy all the objects (tables, users, constraints, etc.) from one SQL Server database to another database, use the Generate Scripts function in SQL Server Management Studio.

  1. In the Object Explorer, right click the name of the database. Select Tasks > Generate Scripts…


  2. The Script Wizard will open. Click Next.


  3. Select the source database. If you want to copy ALL objects, make sure Script all objects in the selected database is checked. If the box is not checked, you will get a chance to choose the objects you want to include later.

    Click Next.


Continue reading

Installing .mobileconfig files on iPad (Setting up MWireless and U-M VPN)

Secure wifi networks often require installation of a certificate on mobile devices trying to connect. Apple provides a utility to allow companies to create configuration (“.mobilconfig”) files for iPhone and iPad that install the appropriate settings and certificates for their wifi network.

These .mobileconfig files can be put on the web for download to the device through Safari, but sometimes this doesn’t work. If the web server is not configured with the correct MIME type (application/x-apple-aspen-config for .mobileconfig files), the device’s Safari browser may not allow it to be downloaded. The link may not even function at all – it is not clickable in some cases.

If this happens, you can still install the .mobilconfig file by downloading it on a laptop or desktop computer and emailing it to your i-device. When you click on the attachment, it should start the installation process. However, you may have to change the extension to “.der” before emailing it to have it recognized as a certificate.

The University of Michigan has .mobilconfig files available for connection to the MWireless network and U-M VPN, and I found that emailing them to my iPad as described above was the only way I could install them.

Continue reading

Drupal OpenWYSIWYG text editor

openwysiwyg_0.thumbnail.gif

One of the biggest drawbacks of Drupal for several years has been the lack of a single rich-text editor that is totally compatible with all browsers. Two years ago, I tested all of the WYSIWYG modules available at the time, found they were all riddled with bugs and incompatibilities, and finally settled on the YUI editor for a large Drupal site I run.

Unfortunately, it never really worked that well: the site’s members upload lots of photos, and it did a poor job of sizing them – users had no idea how to ensure they were not displayed at full resolution – and with 10 megapixel cameras, full resolution is enormous!

Continue reading

Drupal YUI Rich Text Editor: Set maximum image dimensions on uploaded images

The search for the perfect WYSIWYG text editor in Drupal goes on. The best I’ve seen yet is YUI Rich Text Editor, but it still has some serious browser incompatibilities and usability problems. One significant is that there is nothing stopping users from upload a huge image, and not resizing it down using the provided resizing tools.

Now that just most cameras produce images of enormous resolution, users in my Drupal sites’ users often upload gigantic photos, which remain splashed across the entire layout until I get around to fixing them. I finally got tired of correcting users’ posts for them and fixed the CSS so it will never happen again.

Continue reading

The Processing Instruction Target Matching “[xX][mM][lL]” is Not Allowed

When running Java or other types of applications which use an XML file as part of the input, you may see this error: The Processing Instruction Target Matching “[xX][mM][lL]” is Not Allowed.

Often the cause is a malformed XML file, with a common problem being a blank line accidentally inserted before the required first line of the xml:

[ A blank line here will cause the error ]
<?xml version-"1.0"?>
Continue reading

FTP a file from one server to another, automatically

We are using an ASP script to create iCal files from a database, so another department can display the events on their web-based calendar.

Their calendar page is outside the corporate firewall. The ASP script needs to reside on and IIS server within the firewall. I needed a fool-proof way to transfer the ical file nightly out to an external web server so it could be accessed by any calendar applications that need to use it. The best way I’ve found so far is to create a batch file with command-line FTP instructions, and add it to a Windows scheduled task.

  1. To do this with your own files, create a directory that will hold the batch file somewhere on the server. Since the batch file will contain your destination server’s ftp password in plaintext, you will want to secure the directory. Create a Windows or domain account whose password will never change. I happened to have a “utility” domain-based account that already had access to some parts of the server, so I gave that account rights to the new directory.

Continue reading