Friday, August 18, 2006
Mass Mailing: 2061 Connections - July/August 2006
The July/August 2006 issue of 2061 Connections went out at 2:15 on Aug 18, 2006, to 3916 recipients.
Monday, August 14, 2006
Webtrends irregularity
More of the same. No obvious problem, but some quick testing points to the user-agent string. Doesn't really make sense, though, because there are other lines with the same string. Oh well. I took out a whole swath rather than test each line ... but random testing seems to indicate they'll all cause problems.
2006-07-23 05:31:15 W3SVC48143651 WIZZLE 198.151.218.130 GET /includes/styles/aaas.css - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 9256 368 2703
2006-07-23 05:31:15 W3SVC48143651 WIZZLE 198.151.218.130 GET /publications/bsl/Default.htm - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) - - www.project2061.org 200 0 0 41053 251 5374
2006-07-23 05:31:15 W3SVC48143651 WIZZLE 198.151.218.130 GET /includes/styles/2061.css - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 3884 368 937
2006-07-23 05:31:17 W3SVC48143651 WIZZLE 198.151.218.130 GET /includes/scripts/detectstyle.js - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 700 375 937
2006-07-23 05:31:18 W3SVC48143651 WIZZLE 198.151.218.130 GET /includes/scripts/foldoutMenu.js - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 9379 375 1140
2006-07-23 05:31:18 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/plus.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 298 359 812
2006-07-23 05:31:19 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/minus.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 295 360 984
2006-07-23 05:31:19 W3SVC48143651 WIZZLE 198.151.218.130 GET /includes/scripts/jslibrary.js - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 7430 373 1046
2006-07-23 05:31:21 W3SVC48143651 WIZZLE 198.151.218.130 GET /includes/scripts/menuarrays.js - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 3156 374 1031
2006-07-23 05:31:21 W3SVC48143651 WIZZLE 198.151.218.130 GET /includes/scripts/spawnwin.js - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 3314 372 999
2006-07-23 05:31:22 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/pixel.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 290 360 890
2006-07-23 05:31:22 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/main_logo.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 2645 364 968
2006-07-23 05:31:22 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/topmenu_left_off.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 361 371 828
2006-07-23 05:31:22 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/topmenu_sep1.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 399 367 828
2006-07-23 05:31:24 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/topmenu_sep2.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 464 367 874
2006-07-23 05:31:24 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/topmenu_sep3.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 465 367 812
2006-07-23 05:31:24 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/topmenu_right_off.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 368 372 828
2006-07-23 05:31:24 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/leftcol_frame_top.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 405 372 828
2006-07-23 05:31:26 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/01_mainheader_top_programs.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 2086 381 874
2006-07-23 05:31:26 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/header_search.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 689 368 937
2006-07-23 05:31:26 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/btn_search.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 570 365 921
2006-07-23 05:31:26 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/btn_go.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 735 361 843
2006-07-23 05:31:28 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/01_mainheader_sub_programs.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 24512 381 1593
2006-07-23 05:31:28 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/subheader_education_pr.jpg - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 14522 377 2046
2006-07-23 05:31:28 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/tools/bsl/BSLlogo.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 1015 372 828
2006-07-23 05:31:30 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/tools/bsl/BODcov.JPG - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 13784 371 1343
2006-07-23 05:31:30 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/greywhole3.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 2707 365 1124
2006-07-23 05:31:30 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/submenu_bg.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 557 365 828
2006-07-23 05:31:30 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/submenu_blackarrow.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 345 373 812
2006-07-23 05:31:32 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/submenu_arrow.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 387 368 812
2006-07-23 05:31:32 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/submenu3_bg.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 321 366 1015
2006-07-23 05:31:32 W3SVC48143651 WIZZLE 198.151.218.130 GET /images/submenu_bottom.gif - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL;+pagesurvey=3 http://www.project2061.org/publications/bsl/ www.project2061.org 200 0 0 514 383 968
2006-07-23 05:31:34 W3SVC48143651 WIZZLE 198.151.218.130 GET /favicon.ico - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL;+pagesurvey=3 - www.project2061.org 200 0 0 2491 290 874
2006-07-23 05:33:16 W3SVC48143651 WIZZLE 198.151.218.130 GET /includes/styles/2061.css - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL - www.project2061.org 304 0 0 210 398 796
2006-07-23 05:33:16 W3SVC48143651 WIZZLE 198.151.218.130 GET /includes/styles/aaas.css - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL - www.project2061.org 304 0 0 211 399 812
2006-07-23 05:33:16 W3SVC48143651 WIZZLE 198.151.218.130 GET /includes/scripts/detectstyle.js - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL - www.project2061.org 304 0 64 0 408 781
2006-07-23 05:33:16 W3SVC48143651 WIZZLE 198.151.218.130 GET /includes/scripts/foldoutMenu.js - 80 - 202.133.9.242 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322) ASPSESSIONIDAQDTQQTS=NIPAACGBPKHHPPHPIBELLLLL - www.project2061.org 304 0 64 0 408 749
Mass Mailing: 2061 Today - 2006 #1
Sent out on Monday 14 Aug 2006 at 1:05 PM to 1553 recipients.
The send-out was inadvertent. I was doing some final testing of the mailer script and had selected the 2061 Today list to pull the automated footer text. I updated the message (thank goodness) then sent out the message. What I had intended to do was send it to the ad-hoc list (with just my address) to test things and make sure they worked ok.
It's unfortunate, because there were two problems that would have been caught otherwise.
The send-out was inadvertent. I was doing some final testing of the mailer script and had selected the 2061 Today list to pull the automated footer text. I updated the message (thank goodness) then sent out the message. What I had intended to do was send it to the ad-hoc list (with just my address) to test things and make sure they worked ok.
It's unfortunate, because there were two problems that would have been caught otherwise.
- There was a bad link in the e-mail address to project.org
- I hadn't yet uploaded the newsletter to the site. I didn't realize this until a few hours later.
Wednesday, August 09, 2006
MySQL: Using with ASP (after a long stint with MS SQL)
I've started moving tables from MS SQL to MySQL. I began the conversion process with the search from Benchmarks On-Line which went over without a hitch. That was to be expected, though, because that db access is read only ... no inserts/updates necessary. The only area I had to pay special attention to was the cursor type/location and the lock type. I updated these as necessary to best work with MySQL, especially considering the method the data was being used (client forward-only cursor, read-only lock).
Today I worked on moving over the survey from Blueprints On-Line. If I were going to run into any problems they would be pretty evident on this page. The table involved uses text (
I immediatly ran into a problem relating to permissions. For some reason MySQL kept telling me I didn't have access to the table even after I set up permissions. After talking to DP, though, I had a thought and checked out the DSN. I was using the same DSN that I used for the Benchmarks conversion (and plan to do the same for all scripts on the site). But the Benchmarks table is in a completely different database from the Blueprint table. The error message, while correct, was a bit misleading ... the table in question didn't exist in the database being accessed. The permission message was correct, however, in that I hadn't given the user permission to access the table specified. Since I didn't have permission to access the table in question MySQL didn't even bother to check if it existed. Sneaky. I've updated the DSN to have no default table and now specify my connection string as
With this problem fixed I tried out the data read portion of the script. I immediately ran into a problem with some code that uses the data to calculate averages. It appears that in order to use the recordset value directly (i.e. not assigning it to a variable first) you have to first convert it to the appropriate type in VBScript. When using MS SQL I didn't run into this problem ... perhaps because MS SQL reports the data type assigned by the database. MySQL, however, just reports the type as
The read was working correctly so I decided to try out the data insert. I ran into yet another problem, this one more serious than the first. The method I use to do the insert in the survey script is to create a recordset object, use the
With these problems solved things seem to be running smoothly. I'll have to do some more research on the multi-step error and the safe option of MyODBC. In the meantime I'll start working on the other scripts.
I've already thought about one issue I might need to address at some point ... I currently have no development database. Not too happy about that.
Update 2006-08-10:
I've completed conversion of scripts from MS SQL to MySQL. In the process I found some more incompatibilities that need to be dealt with when converting.
First, MySQL does not allow the assignment of non-static values as column defaults (minus a few exceptions). The value must either be a constant or a literal value. Because of this requirement I was running into problems with the
Second, some scripts were taking the result from a
MyODBC does not play as nicely, however. The type returned using the same SQL statement is not recognized by VBScript. Applying a
Yet another best practice that's not followed regularly: explicitly define a variable's type.
Third, I'm running into a problem where a date field with a null value causes the the recordset object to error out when trying to open the conneciton. The error message is "Data provider or other service returned an E_FAIL status." Checking for a null value in the SQL statement using the
Update to the the second issue mentioned above ... I'm running into more widespread problems with numeric types returned by MySQL. Even a regular
Today I worked on moving over the survey from Blueprints On-Line. If I were going to run into any problems they would be pretty evident on this page. The table involved uses text (
TEXT
, VARCHAR
), number (TINYINT
, BIGINT
), and date (DATETIME
) fields. There is both a read and an insert on the table. The survey is unused, so I can test it without worrying about affecting the user experience too much.I immediatly ran into a problem relating to permissions. For some reason MySQL kept telling me I didn't have access to the table even after I set up permissions. After talking to DP, though, I had a thought and checked out the DSN. I was using the same DSN that I used for the Benchmarks conversion (and plan to do the same for all scripts on the site). But the Benchmarks table is in a completely different database from the Blueprint table. The error message, while correct, was a bit misleading ... the table in question didn't exist in the database being accessed. The permission message was correct, however, in that I hadn't given the user permission to access the table specified. Since I didn't have permission to access the table in question MySQL didn't even bother to check if it existed. Sneaky. I've updated the DSN to have no default table and now specify my connection string as
DSN=dnsname;Database=databasename;
.With this problem fixed I tried out the data read portion of the script. I immediately ran into a problem with some code that uses the data to calculate averages. It appears that in order to use the recordset value directly (i.e. not assigning it to a variable first) you have to first convert it to the appropriate type in VBScript. When using MS SQL I didn't run into this problem ... perhaps because MS SQL reports the data type assigned by the database. MySQL, however, just reports the type as
field
. I added a CInt()
whenever the database values were used in a calculation.The read was working correctly so I decided to try out the data insert. I ran into yet another problem, this one more serious than the first. The method I use to do the insert in the survey script is to create a recordset object, use the
AddNew()
function to create a new record, update the columns for the record, then use the Update()
function to update the database. While updating the fields I was running into this error: "Multiple-step operation generated errors. Check each status value." I'm not sure what the reason for the error is, but I did find a solution on the MySQL forums in the thread multiple-step operation generated errors. That would be to turn on the "safe" option in MyODBC. Seems to work, but since I don't know the source of the error (or what the safe option does) it's conceivable that this solution doesn't actually solve the problem and that I'll run into further issues later on.With these problems solved things seem to be running smoothly. I'll have to do some more research on the multi-step error and the safe option of MyODBC. In the meantime I'll start working on the other scripts.
I've already thought about one issue I might need to address at some point ... I currently have no development database. Not too happy about that.
Update 2006-08-10:
I've completed conversion of scripts from MS SQL to MySQL. In the process I found some more incompatibilities that need to be dealt with when converting.
First, MySQL does not allow the assignment of non-static values as column defaults (minus a few exceptions). The value must either be a constant or a literal value. Because of this requirement I was running into problems with the
DATETIME
fields I had set up because the database could not calculate the date when a new field was inserted. This issue led me to one of the exceptions ... TIMESTAMP
fields can be calculated using the CURRENT_TIMESTAMP
function. It looks like from now on I'll be using the TIMESTAMP
data type rather than the DATETIME
data type. For more interesting aspects of this data type check out TIMESTAMP
Properties as of MySQL 4.1.Second, some scripts were taking the result from a
SELECT COUNT()
statement and assigning it to a variable. MS SQL ODBC plays very nicely with ASP/VBScript and the variable type was automatically recognized as numeric. Since VBScript has some basic requirements with regards to using variables this made things very easy.MyODBC does not play as nicely, however. The type returned using the same SQL statement is not recognized by VBScript. Applying a
CInt()
to these values corrects any type mismatch problems.Yet another best practice that's not followed regularly: explicitly define a variable's type.
Third, I'm running into a problem where a date field with a null value causes the the recordset object to error out when trying to open the conneciton. The error message is "Data provider or other service returned an E_FAIL status." Checking for a null value in the SQL statement using the
IFNULL()
function seems provides somewhat of a solution to the problem, except for two issues: 1) the SQL statements involved have to be rewritten, and 2) at least one row is always returned, even if there are no matching rows in the table. The first issue isn't too much of a big deal, but the second one is a show-stopper. I'll have to do some more research.Update to the the second issue mentioned above ... I'm running into more widespread problems with numeric types returned by MySQL. Even a regular
INT
data type seems to be having problems. If I have time I'll do some more research on this one as it'll no doubt be a repeating problem.
MS SQL to MySQL Conversion
Just a few notes I have regarding some considerations to keep in mind when moving from MS SQL to MySQL. Most of these are related to programming in ASP.
Check data types for appropriate conversion. Of special concern:
Check data types for appropriate conversion. Of special concern:
VARCHAR
only allows 255 character in MySQL as opposed to 4000 in MS SQL (depending on the version). Use aTEXT
data type instead.DATETIME
does not allow for dynamic defaults in MySQL. UseTIMESTAMP
instead, which can be set to update to the current time on insert and optionally on update.- Take note of
DATETIME
columns from MS SQL. A precision time may be exported that doesn't import into MySQL. It's easiest to use a regex to trim the time after the seconds value. BLOB
data types (includingTEXT
) won't import into MySQL using MyODBC and DTS. Easiest way to get around this is to export to a CSV/TAB file and import into MySQL.
- Check for any table name quoting. MySQL uses backticks (`).
- Check the cursor type, cursor location, and lock type on any recordset objects. Some options have to be enabled in the DSN to allow certain cursor types (see CursorTypes, LockTypes, and CursorLocations). The following guidelines apply:
- location: client; type: static - recommended for most connections. Static is the only supported cursor type on a client cursor.
- location: server; type: forward only - fast read.
- location: server; type: dynamic - while this cursor type can be specified it is not supported by MySQL natively. The ODBC driver performs extra communication functionality to simulate this type, resulting in significant overhead.
- The keyset cursor type is not supported at all.
- When not performing updates use a read only lock, otherwise use an optimistic lock.
Subscribe to:
Posts (Atom)