How to scramble data
05/06/2010: Updated link DataScramble.mdb
News, links, downloads, tips and tricks on Microsoft Access and related
About Me | Search |
Recently I found quite unpredictable (for me) behavior of SQL Server ISNULL() function. If you use it in Select, both arguments are nvarchar and length of first is less then second – then value of second field will be truncated to the length of first. So, if you run this SQL:
SELECT Address,
ISNULL(Region, Address)
FROM Suppliers
on sample Northwind database – result will be:
9-8 Sekimai Musashino-shi|9-8 Sekimai Mus
92 Setsuko Chuo-ku 92|Setsuko Chuo
Lyngbysild Fiskebakken 10|Lyngbysild Fisk
Any idea why this happens? Fortunately – COALESCE() works correct in this case, so I would recommend using it instead of ISNULL().
The Access Unlimited Newsletter is XML/RSS Newsfeed and email newsletter on Office Automation, Access and VB topics, edited by Garry Robinson, Access MVP, whom I recently met at Microsoft MVP Summit.
If you build a setup package using Access XP Developer Packaging wizard and try to install it on Windows Vista PC – you will get a message "The Office System Pack cannot be installed on this system because it requires Windows NT 4.0 Service Pack 6 or later". There is a KB article 837150 which mention this error, but steps to fix the problem does not work for Vista.
In order to fix this you need to remove 4 lines in Ospfilelist.txt file which starts with:
DBMSADSN.DLL
MSXML.DLL
DBNMPNTW.DLL
SQLOLEDB.DLL
See KB article 837150 for more details how to locate Ospfilelist.txt file.
Jeff Conrad has moved his page, here a new address :
http://www.accessmvp.com/JConrad/accessjunkie.html
Today we made a first meeting at MVP Summit 2007, this time it was at Todai sushi restaurant. Food was really good, but bit too much, anyway you can check our happy faces below.
The main program starts tomorrow, not sure we will have sushi again these days, but certainly we will have other fun. BTW, yesterday, together with Tom Wickerath and Arvin Meyer, we made a great trip to the middle of Washington state, Ellensburg, passing Snoqualmie with its falls and huge log.
This is what I missing in Window Vista settings – as a developer I don’t like UAC, but would like to keep it for my son, who also using out Vista PC. Here a trick from Windows Secrets newsletter:
Step 1. Click the Start button and launch the Local Security Policy editor by entering secpol.msc in the Search box.
Step 2. Select the Local Policies item in the left panel to expand the tree, then expand Security Options under Local Policies.
Step 3. Scroll down the list in the right panel to locate User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode. Right-click that item and choose Properties.
Step 4. Select Elevate without prompting and close the dialog.
If you use Vista Home Basic or Home Premium, the Local Security Policy editor, unfortunately, isn't included. To disable UAC for administrator accounts, you'll need to edit the Registry. Follow these steps to do that — and be extremely careful, since mistakes could render your system unusable!
Step 1. Click Start and enter regedit in the Search box to launch the Registry Editor.
Step 2. Navigate to the following key:
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Policies \ System
Step 3. Double-click the ConsentPromptBehaviorAdmin item.
Step 4. Change the value to 00000000.
Step 5. Close the dialog and exit the Registry Editor.
'Variable to count number of lines
Private mlngLines As Long
Private Sub Detail_Format(Cancel As Integer, _
FormatCount As Integer)
If FormatCount = 1 Then
mlngLines = mlngLines + 1
End If
If mlngLines > 11 Then Cancel = True
End Sub
Private Sub {GroupHeaderName}_Format (Cancel As Integer)
'Reset it for each group
mlngLines = 1
End Sub
There is more two way to do the same in KB article 153747
While we have already knew how to deal with Import or Link mixed type data from Excel, here a trick on export. Today I got a screenshot from customer, who tried to export Access report to Excel and got “Type mismatch” error. Screenshot showed a typical mixed data type column with document numbers, some of them with numbers only, and other started with letters. So export engine made an assumption on a first row that column type is numeric, and later produced the error on non-numeric data. Well, this I can’t say for sure - this was my guess. Anyway – I have opened report’s underlying query and added a space at the end of document number field: Select …. DocNum & “ “ as DocNum, .... And error gone!
Labels: access field type DAO