Paul's Programming Notes     Archive     Feed     Github

SQLSRV30.EXE is not a valid Win32 application

If you want to install the PDO drivers for PHP 5.4, you will need to extract SQLSRV30.EXE with Winrar.

Since I was using EasyPHP, I needed to extract the files into the following directory (there's also another php directory in EasyPHP, not sure why, but it's worth adding the files under "ext" there too): C:\Program Files\EasyPHP-12.1\php\php546x120827090829\ext

You will also need to add the following lines to your PHP.ini file under PHPExt:

extension=php_pdo_sqlsrv_54_ts.dll
extension=php_sqlsrv_54_ts.dll

Managing SQL Server 2008 with Management Studio 2005

When you google "SQL Management Studio", one of the first things that comes up is this (the 2005 version): http://www.microsoft.com/en-us/download/details.aspx?id=8961

I recommend not installing 2005 if you have SQL Server 2008 Express installed! You will not be able to manage your 2008 server, and you will need to uninstall management studio to install the 2008 version here: http://www.microsoft.com/en-us/download/details.aspx?id=22985

Get Folder Path From User Input


This is some very useful code from Stack Overflow which allows the user to select a folder in VBA and reads the folder path into a variable. I'm currently making a macro which opens several XML files in a folder, and this will help users to input the folder where those XML files are located:

Sub SelectFolder()
    Dim diaFolder As FileDialog

    ' Open the file dialog
    Set diaFolder = Application.FileDialog(msoFileDialogFolderPicker)
    diaFolder.AllowMultiSelect = False
    diaFolder.Show

    MsgBox diaFolder.SelectedItems(1)

    Set diaFolder = Nothing
End Sub

VBA - Delete Worksheet With A Specific Name If It Exists

Application.DisplayAlerts = False 
On Error Resume Next 
ThisWorkbook.Sheets("Sheet1").Delete 
On Error Goto 0 
Application.DisplayAlerts = True 

  • The code between "On Error Resume Next" and "On Error Goto 0" will be skipped if an error is generated. 
  • It also won't display the error to the user because of the code on line 1 (Application.DisplayAlerts = False).
  • "ThisWorkbook" will need to be declared.


Modifying PhoneGap Childbrowser View

In IOS, removing the back/forward, refresh, and history buttons from ChildBrowser requires opening its .xib file.

I removed everything except the done button:

UIWebView

My First Stack Overflow Answer

http://stackoverflow.com/questions/11783402/iscroll-and-similar-will-not-scroll-horizontally-phonegap-jqtouch-iphone-app/11852309#11852309

I use Stack Overflow a ton, and I'm going to try to make more of an effort to contribute.

I was having trouble scrolling horizontally with the iscroll plugin, and I solved it by enabling the hScroll option (which I thought should have been enabled by default). I use iscroll's zoom function to enable zooming on a single div, while the rest of the page does not zoom.

SigPad API

I had difficulties getting Thomas J Bradley's HTML5 Signature Pad to let me to use its API without resetting the field. This Github issue explains a workaround:

https://github.com/thomasjbradley/signature-pad/issues/13

He is saving the signature, declaring the api variable, then regenerating the signature.

I needed to use the .getSignatureImage() api function which allows me to turn the signature into a base64 string so I could store the signature in a database.