PB备忘录

◆◆[b][color=red]PB连接MySQL检索数据是乱码的问题[/color][/b]

◇[b]问题描述:[/b]
PB连接MySQL,使用数据窗口检索数据时,检索结果显示都是乱码

◇[b]解决办法:[/b]
在ODBC设置中的CONNECT OPTIONS 中的INITIAL STATEMENT 行写上
[b]SET NAMES 'gbk';[/b]
即可

其中gbk是数据库字符集。
[b]SET NAMES 'gbk';[/b]
相当于下面的三句指令:
[b]SET character_set_client = gbk;
SET character_set_results = gbk;
SET character_set_connection = gbk;[/b]


◆◆[b][color=red]带TitleBar的数据窗口怎样能禁止移动[/color][/b]

◇[b]问题描述:[/b]
怎样能使带TitleBar的数据窗口禁止移动

◇[b]解决办法:[/b]
//在DW的other事件中写如下代码
if wparam = 61458 then
return 2
end if



◆◆[b][color=red]带TitleBar的数据窗口点击关闭按钮时触发代码写在什么地方[/color][/b]

◇[b]问题描述:[/b]
带TitleBar的数据窗口点击关闭按钮时触发代码写在什么地方

◇[b]解决办法:[/b]
//在DW的other事件中写如下代码
//带TitleBar的数据窗口点击关闭按钮时触发
if message.number = 24 then
return 0
end if



◆◆[b][color=red]PB连MYSQL时SQLSTATE=37000错误处理[/color][/b]

◇[b]问题描述:[/b]
开发环境: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

◇[b]解决办法:[/b]
打开ODBC配置窗口Configure Data Source Name-->Advanced-->Flags3,
把Ignore Space Afrer Function Names勾选上即可!
注册表中相应的修改:option设置成4096


◆◆[b][color=red]PB代码异常时怎样自动进入debug[/color][/b]

◇[b]问题描述:[/b]
设置断点调试有时很麻烦,比如for循环,即使在断点设置了条件也不太方便,能不能代码出现异常时自动进入debug状态,并跳到出错的行

◇[b]解决办法:[/b]
tools → system options,把Just In Time Debugging勾选上即可!


◆◆[b][color=red]PB NumberEvent[/color][/b]
//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



◆◆[b][color=red]Powerbuilder常用颜色列表[/color][/b]
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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值