PB备忘录 博客分类: pb PowerBuilderMySQLSQL ServerSQL
程序员文章站
2024-03-22 19:38:36
...
◆◆PB连接MySQL检索数据是乱码的问题
◇问题描述:
PB连接MySQL,使用数据窗口检索数据时,检索结果显示都是乱码
◇解决办法:
在ODBC设置中的CONNECT OPTIONS 中的INITIAL STATEMENT 行写上
SET NAMES 'gbk';
即可
其中gbk是数据库字符集。
SET NAMES 'gbk';
相当于下面的三句指令:
SET character_set_client = gbk;
SET character_set_results = gbk;
SET character_set_connection = gbk;
◆◆带TitleBar的数据窗口怎样能禁止移动
◇问题描述:
怎样能使带TitleBar的数据窗口禁止移动
◇解决办法:
◆◆带TitleBar的数据窗口点击关闭按钮时触发代码写在什么地方
◇问题描述:
带TitleBar的数据窗口点击关闭按钮时触发代码写在什么地方
◇解决办法:
◆◆PB连MYSQL时SQLSTATE=37000错误处理
◇问题描述:
开发环境:PB11.0 + MYSQL5.0
出错代码:
integer li_count
select count(*) into :li_count from table1;
错误提示:
SQLSTATE = 37000
[MySQL][ODBC 3.51 Driver][mysqld-5.0.41-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) from table1' at line 1
◇解决办法:
打开ODBC配置窗口Configure Data Source Name-->Advanced-->Flags3,
把Ignore Space Afrer Function Names勾选上即可!
注册表中相应的修改:option设置成4096
◆◆PB代码异常时怎样自动进入debug
◇问题描述:
设置断点调试有时很麻烦,比如for循环,即使在断点设置了条件也不太方便,能不能代码出现异常时自动进入debug状态,并跳到出错的行
◇解决办法:
tools → system options,把Just In Time Debugging勾选上即可!
◆◆PB NumberEvent
//Here's a list of some of the messages that PowerBuilder uses:
// NumberEvent Number Event
// 768 RetrieveStart
// 769 RetrieveEnd
// 1024 UpdateStart
// 1025 UpdateEnd
// 1280 DoubleClicked
// 1281 Clicked
// 1281 RightDoubleClicked
// 1536 DBError
// 1792 ItemFocusChanged
// 2048 RowFocusChanged
// 2049 SelectionChanged
// 2311 MouseMove
// 2313 LeftButtonUp
// 2314 RightClicked
// 2315 RightButtonUp
// 2317 ScrollHorizontal
// 2318 ScrollVertical
// 2319 SQLPreview
// 2320 Resize
// 2321 PositionChanged
◆◆Powerbuilder常用颜色列表
Powerbuilder常用颜色列表:
Constant Long Black = 0 // RGB( 0, 0, 0)
Constant Long Dark_Red = 128 // RGB( 128, 0, 0)
Constant Long Maroon = 128 // RGB( 128, 0, 0) - on dropdown
Constant Long Light_Red = 192 // RGB( 192, 0, 0)
Constant Long Red = 255 // RGB( 255, 0, 0)
Constant Long Dark_Green = 32768 // RGB( 0, 128, 0) - "Green" on dropdown
Constant Long Brown = 32896 // RGB( 128, 128, 0)
Constant Long Olive = 32896 // RGB( 128, 128, 0) - on dropdown
Constant Long Green = 65280 // RGB( 0, 255, 0)
Constant Long Lime = 65280 // RGB( 0, 255, 0) - on dropdown
Constant Long Yellow = 65535 // RGB( 255, 255, 0)
Constant Long Dark_Blue = 8388608 // RGB( 0, 0, 128)
Constant Long Navy = 8388608 // RGB( 0, 0, 128) - on dropdown
Constant Long Dark_Magenta = 8388736 // RGB( 128, 0, 128)
Constant Long Purple = 8388736 // RGB( 128, 0, 128) - on dropdown
Constant Long Dark_Cyan = 8421376 // RGB( 0, 128, 128)
Constant Long Teal = 8421376 // RGB( 0, 128, 128) - on dropdown
Constant Long Dark_Gray = 8421504 // RGB( 128, 128, 128)
Constant Long Gray = 8421504 // RGB( 128, 128, 128) - on dropdown
Constant Long Light_Gray = 12632256 // RGB( 192, 192, 192)
Constant Long Silver = 12632256 // RGB( 192, 192, 192) - on dropdown
Constant Long Mint = 12639424 // RGB( 192, 220, 192) - on dropdown
Constant Long Sky = 15780518 // RGB( 166, 202, 240) - on dropdown
Constant Long Cream = 15793151 // RGB( 255, 251, 240) - on dropdown
Constant Long Blue = 16711680 // RGB( 0, 0, 255)
Constant Long Fuchsia = 16711935 // RGB( 255, 0, 255) - on dropdown
Constant Long Magenta = 16711935 // RGB( 255, 0, 255)
Constant Long Aqua = 16776960 // RGB( 0, 255, 255) - on dropdown
Constant Long Cyan = 16776960 // RGB( 0, 255, 255)
Constant Long White = 16777215 // RGB( 255, 255, 255)
Constant Long Window_Text = 33554432
Constant Long WndText = 33554432 // - on dropdown
Constant Long Button_Face = 79741120
Constant Long ButtonFace = 79741120 // - on dropdown
Constant Long Application_Work_Space = 275800223
Constant Long AppWrkSpc = 275800223 // - on dropdown
Constant Long Window_Background = 1073741824
Constant Long WndBkrnd = 1073741824 // - on dropdown
◇问题描述:
PB连接MySQL,使用数据窗口检索数据时,检索结果显示都是乱码
◇解决办法:
在ODBC设置中的CONNECT OPTIONS 中的INITIAL STATEMENT 行写上
SET NAMES 'gbk';
即可
其中gbk是数据库字符集。
SET NAMES 'gbk';
相当于下面的三句指令:
SET character_set_client = gbk;
SET character_set_results = gbk;
SET character_set_connection = gbk;
◆◆带TitleBar的数据窗口怎样能禁止移动
◇问题描述:
怎样能使带TitleBar的数据窗口禁止移动
◇解决办法:
//在DW的other事件中写如下代码 if wparam = 61458 then return 2 end if
◆◆带TitleBar的数据窗口点击关闭按钮时触发代码写在什么地方
◇问题描述:
带TitleBar的数据窗口点击关闭按钮时触发代码写在什么地方
◇解决办法:
//在DW的other事件中写如下代码 //带TitleBar的数据窗口点击关闭按钮时触发 if message.number = 24 then return 0 end if
◆◆PB连MYSQL时SQLSTATE=37000错误处理
◇问题描述:
开发环境:PB11.0 + MYSQL5.0
出错代码:
integer li_count
select count(*) into :li_count from table1;
错误提示:
SQLSTATE = 37000
[MySQL][ODBC 3.51 Driver][mysqld-5.0.41-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) from table1' at line 1
◇解决办法:
打开ODBC配置窗口Configure Data Source Name-->Advanced-->Flags3,
把Ignore Space Afrer Function Names勾选上即可!
注册表中相应的修改:option设置成4096
◆◆PB代码异常时怎样自动进入debug
◇问题描述:
设置断点调试有时很麻烦,比如for循环,即使在断点设置了条件也不太方便,能不能代码出现异常时自动进入debug状态,并跳到出错的行
◇解决办法:
tools → system options,把Just In Time Debugging勾选上即可!
◆◆PB NumberEvent
//Here's a list of some of the messages that PowerBuilder uses:
// NumberEvent Number Event
// 768 RetrieveStart
// 769 RetrieveEnd
// 1024 UpdateStart
// 1025 UpdateEnd
// 1280 DoubleClicked
// 1281 Clicked
// 1281 RightDoubleClicked
// 1536 DBError
// 1792 ItemFocusChanged
// 2048 RowFocusChanged
// 2049 SelectionChanged
// 2311 MouseMove
// 2313 LeftButtonUp
// 2314 RightClicked
// 2315 RightButtonUp
// 2317 ScrollHorizontal
// 2318 ScrollVertical
// 2319 SQLPreview
// 2320 Resize
// 2321 PositionChanged
//Event Name: ue_command //Event Id: pbm_command if hwndchild = handle(idwc) then choose case notificationcode case 2048 // RowFocusChanged on DDDW case 2049 // SelectionChanged on DDDW case 768 // RetrieveStart on DDDW case 2313 // LeftButtonUp on DDDW case 1281 // Clicked on DDDW case 2314 // RightClicked on DDDW case 2315 // RightButtonUp on DDDW case 2311 // MouseMove on DDDW end choose end if
◆◆Powerbuilder常用颜色列表
Powerbuilder常用颜色列表:
Constant Long Black = 0 // RGB( 0, 0, 0)
Constant Long Dark_Red = 128 // RGB( 128, 0, 0)
Constant Long Maroon = 128 // RGB( 128, 0, 0) - on dropdown
Constant Long Light_Red = 192 // RGB( 192, 0, 0)
Constant Long Red = 255 // RGB( 255, 0, 0)
Constant Long Dark_Green = 32768 // RGB( 0, 128, 0) - "Green" on dropdown
Constant Long Brown = 32896 // RGB( 128, 128, 0)
Constant Long Olive = 32896 // RGB( 128, 128, 0) - on dropdown
Constant Long Green = 65280 // RGB( 0, 255, 0)
Constant Long Lime = 65280 // RGB( 0, 255, 0) - on dropdown
Constant Long Yellow = 65535 // RGB( 255, 255, 0)
Constant Long Dark_Blue = 8388608 // RGB( 0, 0, 128)
Constant Long Navy = 8388608 // RGB( 0, 0, 128) - on dropdown
Constant Long Dark_Magenta = 8388736 // RGB( 128, 0, 128)
Constant Long Purple = 8388736 // RGB( 128, 0, 128) - on dropdown
Constant Long Dark_Cyan = 8421376 // RGB( 0, 128, 128)
Constant Long Teal = 8421376 // RGB( 0, 128, 128) - on dropdown
Constant Long Dark_Gray = 8421504 // RGB( 128, 128, 128)
Constant Long Gray = 8421504 // RGB( 128, 128, 128) - on dropdown
Constant Long Light_Gray = 12632256 // RGB( 192, 192, 192)
Constant Long Silver = 12632256 // RGB( 192, 192, 192) - on dropdown
Constant Long Mint = 12639424 // RGB( 192, 220, 192) - on dropdown
Constant Long Sky = 15780518 // RGB( 166, 202, 240) - on dropdown
Constant Long Cream = 15793151 // RGB( 255, 251, 240) - on dropdown
Constant Long Blue = 16711680 // RGB( 0, 0, 255)
Constant Long Fuchsia = 16711935 // RGB( 255, 0, 255) - on dropdown
Constant Long Magenta = 16711935 // RGB( 255, 0, 255)
Constant Long Aqua = 16776960 // RGB( 0, 255, 255) - on dropdown
Constant Long Cyan = 16776960 // RGB( 0, 255, 255)
Constant Long White = 16777215 // RGB( 255, 255, 255)
Constant Long Window_Text = 33554432
Constant Long WndText = 33554432 // - on dropdown
Constant Long Button_Face = 79741120
Constant Long ButtonFace = 79741120 // - on dropdown
Constant Long Application_Work_Space = 275800223
Constant Long AppWrkSpc = 275800223 // - on dropdown
Constant Long Window_Background = 1073741824
Constant Long WndBkrnd = 1073741824 // - on dropdown
上一篇: JAVA面试6174问题。
下一篇: ubuntu nginx设置脚本