运行游戏时出现错误,弹出 D3DXCreateFontexcel indirectt FALSE

ACM错误提示、常见问题_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
80页2下载券12页免费26页免费27页免费7页免费9页免费8页免费12页1下载券1页4下载券76页1下载券
喜欢此文档的还喜欢12页免费12页免费63页免费
ACM错误提示、常见问题|
把文档贴到Blog、BBS或个人站等:
普通尺寸(450*500pix)
较大尺寸(630*500pix)
你可能喜欢小弟我从网上下载了JSP编写的网上书店管理系统,如何让他运行看效果_小弟我从网上下载了一个VC++的五子棋的程序,但在VS2005中运行时出现了error C2440: “=”: 无法从“CWnd *”转换为“HWND”异常_小弟我从网上下载了一个留言板的PHP代码,可是浏览器中不能显示Mysql内容__脚本百事通
稍等,加载中……
^_^请注意,有可能下面的2篇文章才是您想要的内容:
小弟我从网上下载了JSP编写的网上书店管理系统,如何让他运行看效果
小弟我从网上下载了一个VC++的五子棋的程序,但在VS2005中运行时出现了error C2440: “=”: 无法从“CWnd *”转换为“HWND”异常
小弟我从网上下载了一个留言板的PHP代码,可是浏览器中不能显示Mysql内容
小弟我从网上下载了JSP编写的网上书店管理系统,如何让他运行看效果
我从网上下载了JSP编写的网上书店管理系统,怎么让他运行看效果?我已经安好了JAVA虚拟机和TOMCAT然后把哪部份代码放在哪个文件夹下啊?------解决方案--------------------配置JAVA TOMCAT
然后把下的东西解压,放在TOMCAT的WEBAPPS下.....运行TOMCAT...
------解决方案--------------------看下来的说明。应该有的
------解决方案--------------------放在webapps目录下即可。如果是war包的你连解压也不需要了
------解决方案--------------------找本有关TOMCAT书肯定有介绍如何配置及部署,按照步骤一步一步来就好
小弟我从网上下载了一个VC++的五子棋的程序,但在VS2005中运行时出现了error C2440: “=”: 无法从“CWnd *”转换为“HWND”异常
我从网上下载了一个VC++的五子棋的程序,但在VS2005中运行时出现了error C2440: “=”: 无法从“CWnd *”转换为“HWND”错误,请高手帮忙//
FiveDlg.cpp
implementation
"stdafx.h "
"FiveDlg.h "
"ServerDlg.h "
"ClientDlg.h "
"NameDlg.h "
"StatDlg.h "
"AboutDlg.h "
"Table.h "
THIS_FILE[]
/////////////////////////////////////////////////////////////////////////////
CFiveDlg::CFiveDlg(CWnd*
/*=NULL*/)
CDialog(CFiveDlg::IDD,
//{{AFX_DATA_INIT(CFiveDlg)
//}}AFX_DATA_INIT
subsequent
DestroyIcon
AfxGetApp()-& LoadIcon(IDR_MAINFRAME);
CFiveDlg::DoDataExchange(CDataExchange*
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFiveDlg)
DDX_Control(pDX,
IDC_EDT_CHAT,
m_ChatList);
//}}AFX_DATA_MAP
BEGIN_MESSAGE_MAP(CFiveDlg,
//{{AFX_MSG_MAP(CFiveDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_COMMAND(ID_MENU_1P,
ON_BN_CLICKED(IDC_BTN_BACK,
OnBtnBack)
ON_COMMAND(ID_MENU_PC,
ON_COMMAND(ID_MENU_SERVER,
OnMenuServer)
ON_COMMAND(ID_MENU_CLIENT,
OnMenuClient)
ON_WM_SETCURSOR()
ON_BN_CLICKED(IDC_BTN_HQ,
ON_BN_CLICKED(IDC_BTN_LOST,
OnBtnLost)
ON_COMMAND(ID_MENU_LEAVE,
OnMenuLeave)
ON_COMMAND(ID_MENU_PLAYAGAIN,
OnMenuPlayagain)
ON_COMMAND(ID_MENU_NAME,
OnMenuName)
ON_COMMAND(ID_MENU_STAT,
OnMenuStat)
ON_COMMAND(ID_MENU_EXIT,
OnMenuExit)
ON_COMMAND(ID_MENU_ABOUT,
OnMenuAbout)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
CFiveDlg::OnInitDialog()
CDialog::OnInitDialog();
automatically
application 's
SetIcon(m_hIcon,
SetIcon(m_hIcon,
initialization
m_Table.CreateEx(
WS_EX_CLIENTEDGE,
_T( "ChessTable "),
WS_VISIBLE
设置双方姓名
SetDlgItemText(
IDC_ST_ME,
m_Table.m_strMe
SetDlgItemText(
IDC_ST_ENEMY,
_T( "无玩家加入 ")
禁用“再玩”和“离开”
GetMenu();
pMenu-& EnableMenuItem(
ID_MENU_PLAYAGAIN,
MF_DISABLED
MF_BYCOMMAND
pMenu-& EnableMenuItem(
ID_MENU_LEAVE,
MF_DISABLED
MF_BYCOMMAND
捕获聊天输入框句柄,供处理回车使用
FindWindowEx(
GetDlgItem(
IDC_CMB_CHAT
)-& GetSafeHwnd(),
_T( "Edit "),
::SendMessage(
EM_LIMITTEXT,
(WPARAM)128,
m_Table.Clear(
GetDlgItem(
IDC_CMB_CHAT
)-& EnableWindow(
GetDlgItem(
IDC_BTN_BACK
)-& EnableWindow(
GetDlgItem(
IDC_BTN_HQ
)-& EnableWindow(
GetDlgItem(
IDC_BTN_LOST
)-& EnableWindow(
以上是错误的代码,我双击错误的时候指针停在
FindWindowEx(
GetDlgItem(
IDC_CMB_CHAT
)-& GetSafeHwnd(),
_T( "Edit "),
的前边------解决方案--------------------没什么问题啊
改成这样看看
m_hChat = FindWindowEx((GetDlgItem( IDC_CMB_CHAT )-& m_hWnd),NULL, _T( "Edit "), NULL ); ------解决方案--------------------m_hChat 难道是HWND类型的?FindWindEx返回的是CWnd* 类型的
小弟我从网上下载了一个留言板的PHP代码,可是浏览器中不能显示Mysql内容
求教:我从网上下载了一个留言板的PHP代码,可是浏览器中不能显示Mysql内容我从网上下载了一个留言板的PHP代码,可是在浏览器中不能显示Mysql表里的内容,没有显示错误,就是空白,不知道是哪部分代码错误,请有经验的朋友帮我看看,谢谢。
下面是原代码
&!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&
&meta http-equiv="Content-Type" content="text/ charset=gb2312"&
&title&无标题文档&/title&
$DBhost = "localhost"; // 服务器名字
$DBuser = "用户名(已有)"; // 用户名
$DBpass = "密码(已有)"; // 用户密碼
$DBName = "super-tomato"; //资料库名字
$table = "guestbook"; // 资料库的table名
$numComments = 10; // 每頁所显示的笔数
//开始连接mysql
$DBConn = mysql_connect($DBhost,$DBuser,$DBpass) or die("无法连接资料库: " . mysql_error());
//选择mysql资料库
mysql_select_db($DBName, $DBConn) or die("无法连接资料库: " . mysql_error());
$action = $_GET['action']; //等待执行動作
switch($action) { //這裡使用switch ....case, 我想大家不陌生吧... 在AS當中也有
case 'read' : //读取资料
// sql指令...选择资料表的內容
$sql = 'SELECT * FROM `' . $table . '`';
$allComments = mysql_query($sql, $DBConn) or die("无法选取资料 : " . mysql_error());
$numallComments = mysql_num_rows($allComments); //取得返回资料的笔数
$sql .= ' ORDER BY `time` DESC LIMIT ' . $_GET['NumLow'] . ', ' . $numC
$fewComments = mysql_query($sql, $DBConn) or die("无法选取资料 : " . mysql_error());
$numfewComments = mysql_num_rows($fewComments);
print '&totalEntries=' . $numallComments . '&';
print "&br&&entries=";
if($numallComments == 0) {
print "目前无任何记录....";
while ($array = mysql_fetch_array($fewComments)) {
$name = mysql_result($fewComments, $i, 'name');
$email = mysql_result($fewComments, $i, 'email');
$comments = mysql_result($fewComments, $i, 'comments');
$time = mysql_result($fewComments, $i, 'time');
print '&b&姓名: &/b&' . $name . '&br&&b&邮箱: &/b&' . $email . '&br&&b&留言: &/b&' . $comments . '&br&日期: ' . $time . '&br&&br&';
case 'write' : //写记录
// 接收Flash传过来的资料
$name = ereg_replace("&", "%26", $_POST['userName']);
$email = ereg_replace("&", "%26", $_POST['userEmail']);
$comments = ereg_replace("&", "%26", $_POST['userMessage']);
$todayDate = date ("Y-m-d H:i:s",time()); // 取得目前服务器的时间
// 把资料写入资料表內
$sql = "INSERT INTO " . $table . " (name, email, comments, time) VALUES ('$name', '$email', '$comments', '$todayDate')";
$insert = mysql_query($sql, $DBConn) or die("无法连接到数据库: " . mysql_error());
if($insert) {
print '$msg=Successful';
print '$msg=Error';
------解决方案--------------------其实就是错了,只是你错误模式没有开而已,你打开错误模式后再看看。
如果您喜欢IT行业或者对IT行业感兴趣,想开拓技术视野,欢迎加入本站官方QQ群:,在群里认识新朋友和交流技术^_^
本站联系邮箱:EXCEL 宏正常录制 运行时出现错误 错误代码1004 请高手帮我看看!以下是宏代码
EXCEL 宏正常录制 运行时出现错误 错误代码1004 请高手帮我看看!以下是宏代码 80
Sub 对账单()'' 对账单 Macro'
'&&& ActiveCell.Offset(0, 9).Columns("A:D").EntireColumn.Select&&& Selection.Delete Shift:=xlToLeft&&& ActiveCell.Select&&& With Selection.Interior&&&&&&& .Pattern = xlNone&&&&&&& .TintAndShade = 0&&&&&&& .PatternTintAndShade = 0&&& End With&&& Selection.Borders(xlDiagonalDown).LineStyle = xlNone&&& Selection.Borders(xlDiagonalUp).LineStyle = xlNone&&& Selection.Borders(xlEdgeLeft).LineStyle = xlNone&&& Selection.Borders(xlEdgeTop).LineStyle = xlNone&&& Selection.Borders(xlEdgeBottom).LineStyle = xlNone&&& Selection.Borders(xlEdgeRight).LineStyle = xlNone&&& Selection.Borders(xlInsideVertical).LineStyle = xlNone&&& Selection.Borders(xlInsideHorizontal).LineStyle = xlNone&&& With Selection&&&&&&& .HorizontalAlignment = xlCenter&&&&&&& .VerticalAlignment = xlBottom&&&&&&& .WrapText = False&&&&&&& .Orientation = 0&&&&&&& .AddIndent = False&&&&&&& .ShrinkToFit = False&&&&&&& .ReadingOrder = xlContext&&&&&&& .MergeCells = False&&& End With&&& ActiveCell.FormulaR1C1 = "已收货款"&&& With ActiveCell.Characters(Start:=1, Length:=4).Font&&&&&&& .Name = "宋体"&&&&&&& .FontStyle = "加粗"&&&&&&& .Size = 12&&&&&&& .Strikethrough = False&&&&&&& .Superscript = False&&&&&&& .Subscript = False&&&&&&& .OutlineFont = False&&&&&&& .Shadow = False&&&&&&& .Underline = xlUnderlineStyleNone&&&&&&& .ColorIndex = 11&&&&&&& .TintAndShade = 0&&&&&&& .ThemeFont = xlThemeFontNone&&& End With&&& ActiveCell.Offset(0, 1).Range("A1").Select&&& With Selection.Interior&&&&&&& .Pattern = xlNone&&&&&&& .TintAndShade = 0&&&&&&& .PatternTintAndShade = 0&&& End With&&& Selection.Borders(xlDiagonalDown).LineStyle = xlNone&&& Selection.Borders(xlDiagonalUp).LineStyle = xlNone&&& Selection.Borders(xlEdgeLeft).LineStyle = xlNone&&& Selection.Borders(xlEdgeTop).LineStyle = xlNone&&& Selection.Borders(xlEdgeBottom).LineStyle = xlNone&&& Selection.Borders(xlEdgeRight).LineStyle = xlNone&&& Selection.Borders(xlInsideVertical).LineStyle = xlNone&&& Selection.Borders(xlInsideHorizontal).LineStyle = xlNone&&& With Selection&&&&&&& .HorizontalAlignment = xlCenter&&&&&&& .VerticalAlignment = xlBottom&&&&&&& .WrapText = False&&&&&&& .Orientation = 0&&&&&&& .AddIndent = False&&&&&&& .ShrinkToFit = False&&&&&&& .ReadingOrder = xlContext&&&&&&& .MergeCells = False&&& End With&&& ActiveCell.FormulaR1C1 = "应收余款"&&& With ActiveCell.Characters(Start:=1, Length:=4).Font&&&&&&& .Name = "宋体"&&&&&&& .FontStyle = "加粗"&&&&&&& .Size = 12&&&&&&& .Strikethrough = False&&&&&&& .Superscript = False&&&&&&& .Subscript = False&&&&&&& .OutlineFont = False&&&&&&& .Shadow = False&&&&&&& .Underline = xlUnderlineStyleNone&&&&&&& .ColorIndex = 11&&&&&&& .TintAndShade = 0&&&&&&& .ThemeFont = xlThemeFontNone&&& End With&&& ActiveCell.Offset(0, -2).Range("A1").Select&&& ActiveCell.FormulaR1C1 = "应收账款(元)"&&& ActiveCell.Offset(0, 1).Range("A1").Select&&& ActiveCell.FormulaR1C1 = "已收货款(元)"&&& ActiveCell.Offset(0, 1).Range("A1").Select&&& ActiveCell.FormulaR1C1 = "应收余款(元)"&&& ActiveCell.Rows("1:1").EntireRow.Select&&& Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove&&& ActiveCell.Offset(2, 4).Range("A1").Select&&& Selection.Copy&&& ActiveCell.Offset(-2, -4).Range("A1").Select&&& ActiveSheet.Paste&&& ActiveCell.Offset(0, 4).Columns("A:A").EntireColumn.Select&&& Application.CutCopyMode = False&&& Selection.Delete Shift:=xlToLeft&&& ActiveCell.Offset(1, -4).Range("A1:J1").Select&&& Selection.AutoFilter&&& ActiveCell.Offset(0, 4).Range("A1").Select&&& ActiveSheet.Range("$A$2:$J$109").AutoFilter Field:=5, Criteria1:="(冲销应收款)"&&& ActiveCell.Offset(1, 3).Range("A1:A108").Select&&& Selection.SpecialCells(xlCellTypeVisible).Select&&& Selection.Copy&&& ActiveCell.Offset(0, 1).Range("A1").Select&&& ActiveSheet.Paste&&& Application.CutCopyMode = False&&& ActiveCell.Offset(0, -1).Range("A1:A108").Select&&& Selection.SpecialCells(xlCellTypeVisible).Select&&& Selection.ClearContents&&& ActiveCell.Offset(0, 1).Columns("A:A").EntireColumn.Select&&& Selection.Replace What:="-", Replacement:="", LookAt:=xlPart, _&&&&&&& SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _&&&&&&& ReplaceFormat:=False&&& ActiveSheet.Range("$A$2:$J$109").AutoFilter Field:=5&&& ActiveWindow.SmallScroll Down:=-57&&& ActiveCell.Offset(0, -8).Range("A1").Select&&& Selection.End(xlDown).Select&&& ActiveCell.Offset(1, 0).Range("A1:C1").Select&&& With Selection&&&&&&& .HorizontalAlignment = xlCenter&&&&&&& .VerticalAlignment = xlBottom&&&&&&& .WrapText = False&&&&&&& .Orientation = 0&&&&&&& .AddIndent = False&&&&&&& .IndentLevel = 0&&&&&&& .ShrinkToFit = False&&&&&&& .ReadingOrder = xlContext&&&&&&& .MergeCells = False&&& End With&&& Selection.Merge&&& ActiveCell.FormulaR1C1 = "合计"&&& With ActiveCell.Characters(Start:=1, Length:=2).Font&&&&&&& .Name = "宋体"&&&&&&& .FontStyle = "常规"&&&&&&& .Size = 12&&&&&&& .Strikethrough = False&&&&&&& .Superscript = False&&&&&&& .Subscript = False&&&&&&& .OutlineFont = False&&&&&&& .Shadow = False&&&&&&& .Underline = xlUnderlineStyleNone&&&&&&& .ColorIndex = xlAutomatic&&&&&&& .TintAndShade = 0&&&&&&& .ThemeFont = xlThemeFontNone&&& End With&&& ActiveCell.Offset(1, 0).Range("A1").Select&&& ActiveWindow.SmallScroll Down:=-99&&& ActiveCell.Offset(-110, 0).Range("A1").Select&&& Range(Selection, Selection.End(xlDown)).Select&&& ActiveWindow.SmallScroll Down:=-99&&& ActiveCell.Range("A1:J1").Select&&& With Selection&&&&&&& .HorizontalAlignment = xlCenter&&&&&&& .VerticalAlignment = xlBottom&&&&&&& .WrapText = False&&&&&&& .Orientation = 0&&&&&&& .AddIndent = False&&&&&&& .IndentLevel = 0&&&&&&& .ShrinkToFit = False&&&&&&& .ReadingOrder = xlContext&&&&&&& .MergeCells = False&&& End With&&& Selection.Merge&&& Selection.Font.Bold = True&&& ActiveCell.Cells.Select&&& With Selection.Font&&&&&&& .Name = "宋体"&&&&&&& .Size = 10&&&&&&& .Strikethrough = False&&&&&&& .Superscript = False&&&&&&& .Subscript = False&&&&&&& .OutlineFont = False&&&&&&& .Shadow = False&&&&&&& .Underline = xlUnderlineStyleNone&&&&&&& .TintAndShade = 0&&&&&&& .ThemeFont = xlThemeFontNone&&& End With&&& ActiveCell.Range("A1:J1").Select&&& With Selection.Font&&&&&&& .Name = "宋体"&&&&&&& .Size = 14&&&&&&& .Strikethrough = False&&&&&&& .Superscript = False&&&&&&& .Subscript = False&&&&&&& .OutlineFont = False&&&&&&& .Shadow = False&&&&&&& .Underline = xlUnderlineStyleNone&&&&&&& .ColorIndex = xlAutomatic&&&&&&& .TintAndShade = 0&&&&&&& .ThemeFont = xlThemeFontNone&&& End With&&& ActiveCell.Range("A1:J1").Select&&& Range(Selection, Selection.End(xlDown)).Select&&& Selection.Borders(xlDiagonalDown).LineStyle = xlNone&&& Selection.Borders(xlDiagonalUp).LineStyle = xlNone&&& With Selection.Borders(xlEdgeLeft)&&&&&&& .LineStyle = xlContinuous&&&&&&& .ColorIndex = 0&&&&&&& .TintAndShade = 0&&&&&&& .Weight = xlThin&&& End With&&& With Selection.Borders(xlEdgeTop)&&&&&&& .LineStyle = xlContinuous&&&&&&& .ColorIndex = 0&&&&&&& .TintAndShade = 0&&&&&&& .Weight = xlThin&&& End With&&& With Selection.Borders(xlEdgeBottom)&&&&&&& .LineStyle = xlContinuous&&&&&&& .ColorIndex = 0&&&&&&& .TintAndShade = 0&&&&&&& .Weight = xlThin&&& End With&&& With Selection.Borders(xlEdgeRight)&&&&&&& .LineStyle = xlContinuous&&&&&&& .ColorIndex = 0&&&&&&& .TintAndShade = 0&&&&&&& .Weight = xlThin&&& End With&&& With Selection.Borders(xlInsideVertical)&&&&&&& .LineStyle = xlContinuous&&&&&&& .ColorIndex = 0&&&&&&& .TintAndShade = 0&&&&&&& .Weight = xlThin&&& End With&&& With Selection.Borders(xlInsideHorizontal)&&&&&&& .LineStyle = xlContinuous&&&&&&& .ColorIndex = 0&&&&&&& .TintAndShade = 0&&&&&&& .Weight = xlThin&&& End WithEnd Sub
补充:可以附上你的QQ我远程给你看
光看是不行的,还是要自己调试的,以后遇上类似问题你也是要学会调试程序的,我的好多代码都是这样修正的。
我是个菜鸟 不会调试。
打开vb编辑器,打开宏对应的模块,点工具栏中,运行,这时如果有问题,会中断,问题行就显示出来啦。。。最好你找同事帮你一下,一次学习后,以后就可以自己解决
&&& ActiveCell.Offset(-68, 0).Range("A1:J1").Select
显示这段代码错误。那我咋知道他怎么不对了呢
ActiveCell.Offset(-68, 0).
先要知道.Offset(-68, 0)的意思,我不知道你的具体操作,能不能去掉Offset(-68, 0)看看
用ActiveCell.Range("A1:J1").Select看看结果会咋样,不过要记得你修改的行,不行再改回来,如果不能去掉,得找其他原因。。。。
代码调试,并不一定要知道所有计算机语言,只要你明白代码与之对应行为,再做出相应的判断,我的很多小程序都是这样做出来的,录制的宏有时可以去掉一些不必要的动作。。。
不好意思 还是要麻烦你& 我这步的意思是“指定单元格到有内容的单元格最下面一行的下面一行” 你看我应该如何操作呢?
可能问题就在这,如果选定的全空白,你的代码就不可以在运行啦,需要做一个补救,或转跳过程。。。。
你先前一步帮我调试的 我试过还是不行! 我该怎么调试呢?
我在空白表调试,代码第一个ActiveCell.Offset就出现语句指向工作表行的末端
ActiveCell.Offset(-68, 0)语句指向工作表行的末端,产生错误,必须解决使它不能,指向末端,要限制它指向末端,必须有个限制,在过程中先将表格格式化,在一些位置输入字符这样不会产生指向末端问题。我用的是2003,你的好像与我的不一样& .TintAndShade = 0语句在我这不能用,我除掉了,分段调试运行后,所有ActiveCell.Offset语句都有指向工作表最后一行。。。
我的是2007, 我的意思是指向有内容的最后一个单元格的下面一行 我是按Ctrl+↓ ,↓来录制的这两个步骤的 你用空白的是要指到末端的咯
我知道,运行时总行数超过最大行数啦,你有没检查过。。。系统不允许的,反正所有过程中,不论是行还是列,都不能超过行列最大数。。。问题在这,你自己慢慢去解决吧,学会自己改写代码吧。。。如果我们都是2007的,我会调试出来的。。。。
其他回答 (1)
LZ想出现什么结果呢?
相关知识等待您来回答
微软专区领域专家VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{6FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA.0#0"; "MSDATLST.OCX"
Begin VB.Form main_jbzl_sp
BorderStyle
'Fixed Dialog
"防止数据保存时出现运行时错误"
ClientHeight
ClientLeft
ClientWidth
"main_jbzl_sp.frx":0000
ScaleHeight
ScaleWidth
ShowInTaskbar
StartUpPosition =
Begin MSAdodcLib.Adodc Adodc3
ConnectMode
CursorLocation
IsolationLevel
ConnectionTimeout=
CommandTimeout
CursorType
CommandType
CursorOptions
MaxRecords
ConnectStringType=
Appearance
Orientation
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_sell.Persist Security Info=False"
OLEDBString
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_sell.Persist Security Info=False"
DataSourceName
OtherAttributes =
RecordSource
BeginProperty Font {0BE-11CE-9DE3-00AA004BB851}
Strikethrough
EndProperty
Begin MSAdodcLib.Adodc Adodc2
ConnectMode
CursorLocation
IsolationLevel
ConnectionTimeout=
CommandTimeout
CursorType
CommandType
CursorOptions
MaxRecords
ConnectStringType=
Appearance
Orientation
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_sell.Persist Security Info=False"
OLEDBString
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_sell.Persist Security Info=False"
DataSourceName
OtherAttributes =
RecordSource
"商品类别表"
BeginProperty Font {0BE-11CE-9DE3-00AA004BB851}
Strikethrough
EndProperty
Begin MSAdodcLib.Adodc Adodc1
ConnectMode
CursorLocation
IsolationLevel
ConnectionTimeout=
CommandTimeout
CursorType
CommandType
CursorOptions
MaxRecords
ConnectStringType=
Appearance
Orientation
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_sell.Persist Security Info=False"
OLEDBString
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_sell.Persist Security Info=False"
DataSourceName
OtherAttributes =
RecordSource
"select * from 商品信息表"
BeginProperty Font {0BE-11CE-9DE3-00AA004BB851}
Strikethrough
EndProperty
Begin MSDataGridLib.DataGrid DataGrid1
"main_jbzl_sp.frx":164A
AllowUpdate
FormatLocked
BeginProperty HeadFont {0BE-11CE-9DE3-00AA004BB851}
Strikethrough
EndProperty
BeginProperty Font {0BE-11CE-9DE3-00AA004BB851}
Strikethrough
EndProperty
ColumnCount
BeginProperty Column00
"商品类别"
"商品类别"
BeginProperty DataFormat {6DB-11D0-C91110ED}
HaveTrueFalseNull=
FirstDayOfWeek
FirstWeekOfYear =
SubFormatType
EndProperty
EndProperty
BeginProperty Column01
"商品名称"
"商品名称"
BeginProperty DataFormat {6DB-11D0-C91110ED}
HaveTrueFalseNull=
FirstDayOfWeek
FirstWeekOfYear =
SubFormatType
EndProperty
EndProperty
BeginProperty Column02
BeginProperty DataFormat {6DB-11D0-C91110ED}
HaveTrueFalseNull=
FirstDayOfWeek
FirstWeekOfYear =
SubFormatType
EndProperty
EndProperty
BeginProperty Column03
BeginProperty DataFormat {6DB-11D0-C91110ED}
HaveTrueFalseNull=
FirstDayOfWeek
FirstWeekOfYear =
SubFormatType
EndProperty
EndProperty
BeginProperty Column04
BeginProperty DataFormat {6DB-11D0-C91110ED}
HaveTrueFalseNull=
FirstDayOfWeek
FirstWeekOfYear =
SubFormatType
EndProperty
EndProperty
BeginProperty Column05
BeginProperty DataFormat {6DB-11D0-C91110ED}
HaveTrueFalseNull=
FirstDayOfWeek
FirstWeekOfYear =
SubFormatType
EndProperty
EndProperty
BeginProperty Column06
"库存数量"
"库存数量"
BeginProperty DataFormat {6DB-11D0-C91110ED}
HaveTrueFalseNull=
FirstDayOfWeek
FirstWeekOfYear =
SubFormatType
EndProperty
EndProperty
BeginProperty Column07
BeginProperty DataFormat {6DB-11D0-C91110ED}
HaveTrueFalseNull=
FirstDayOfWeek
FirstWeekOfYear =
SubFormatType
EndProperty
EndProperty
BeginProperty Column08
"存放库位"
"存放库位"
BeginProperty DataFormat {6DB-11D0-C91110ED}
HaveTrueFalseNull=
FirstDayOfWeek
FirstWeekOfYear =
SubFormatType
EndProperty
EndProperty
SplitCount
BeginProperty Split0
MarqueeStyle
BeginProperty Column00
ColumnWidth
EndProperty
BeginProperty Column01
ColumnWidth
EndProperty
BeginProperty Column02
ColumnWidth
EndProperty
BeginProperty Column03
ColumnWidth
EndProperty
BeginProperty Column04
ColumnWidth
EndProperty
BeginProperty Column05
ColumnWidth
EndProperty
BeginProperty Column06
ColumnWidth
EndProperty
BeginProperty Column07
ColumnWidth
EndProperty
BeginProperty Column08
ColumnWidth
EndProperty
EndProperty
Begin MSComctlLib.ImageList ImageList1
ImageWidth
ImageHeight
BeginProperty Images {2C247F25--B16A-00C0F0283628}
NumListImages
BeginProperty ListImage1 {2C247F27--B16A-00C0F0283628}
"main_jbzl_sp.frx":165F
EndProperty
BeginProperty ListImage2 {2C247F27--B16A-00C0F0283628}
"main_jbzl_sp.frx":1F39
EndProperty
BeginProperty ListImage3 {2C247F27--B16A-00C0F0283628}
"main_jbzl_sp.frx":2813
EndProperty
BeginProperty ListImage4 {2C247F27--B16A-00C0F0283628}
"main_jbzl_sp.frx":30ED
EndProperty
BeginProperty ListImage5 {2C247F27--B16A-00C0F0283628}
"main_jbzl_sp.frx":39C7
EndProperty
BeginProperty ListImage6 {2C247F27--B16A-00C0F0283628}
"main_jbzl_sp.frx":42A1
EndProperty
BeginProperty ListImage7 {2C247F27--B16A-00C0F0283628}
"main_jbzl_sp.frx":4B7B
EndProperty
EndProperty
Begin MSComctlLib.Toolbar Toolbar1
'Align Top
ButtonWidth
ButtonHeight
Appearance
"ImageList1"
BeginProperty Buttons {63-11D1-B16A-00C0F0283628}
NumButtons
BeginProperty Button1 {66833FEA--B16A-00C0F0283628}
ImageIndex
EndProperty
BeginProperty Button2 {66833FEA--B16A-00C0F0283628}
ImageIndex
EndProperty
BeginProperty Button3 {66833FEA--B16A-00C0F0283628}
ImageIndex
EndProperty
BeginProperty Button4 {66833FEA--B16A-00C0F0283628}
ImageIndex
EndProperty
BeginProperty Button5 {66833FEA--B16A-00C0F0283628}
ImageIndex
EndProperty
BeginProperty Button6 {66833FEA--B16A-00C0F0283628}
EndProperty
BeginProperty Button7 {66833FEA--B16A-00C0F0283628}
EndProperty
BeginProperty Button8 {66833FEA--B16A-00C0F0283628}
EndProperty
BeginProperty Button9 {66833FEA--B16A-00C0F0283628}
EndProperty
BeginProperty Button10 {66833FEA--B16A-00C0F0283628}
EndProperty
BeginProperty Button11 {66833FEA--B16A-00C0F0283628}
ImageIndex
EndProperty
EndProperty
BorderStyle
Begin VB.Frame Frame1
Begin VB.TextBox Text1
Begin VB.TextBox Text1
Begin VB.TextBox Text1
Begin MSDataListLib.DataCombo DataCombo1
"main_jbzl_sp.frx":5A55
"商品类别"
"DataCombo1"
Begin VB.TextBox Text1
Begin VB.TextBox Text1
Begin VB.TextBox Text1
Begin VB.TextBox Text1
Begin MSDataListLib.DataCombo DataCombo2
"main_jbzl_sp.frx":5A6A
"库位名称"
"DataCombo1"
Begin VB.Label Label6
Begin VB.Label Label9
Begin VB.Label Label8
"存放库位"
Begin VB.Label Label7
"库存数量"
Begin VB.Label Label5
Begin VB.Label Label4
"商品规格"
Begin VB.Label Label3
"商品单位"
Begin VB.Label Label2
"商品名称"
Begin VB.Label Label1
"商品类别"
Attribute VB_Name = "main_jbzl_sp"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public rs1 As New ADODB.Recordset
Public blnAdd As Boolean
Public i As Integer
Sub view_data()
If Adodc1.Recordset.RecordCount & 0 Then
For i = 1 To Text1.UBound
Text1(i) = DataGrid1.Columns(i).Text
DataCombo1 = DataGrid1.Columns(0)
DataCombo2 = DataGrid1.Columns(8)
Private Sub DataCombo1_GotFocus()
DataCombo1.BackColor = &HFFFF00
Private Sub DataCombo1_LostFocus()
DataCombo1.BackColor = &H
Private Sub DataCombo2_GotFocus()
DataCombo2.BackColor = &HFFFF00
Private Sub DataCombo2_LostFocus()
DataCombo2.BackColor = &H
Private Sub DataCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text1(1).SetFocus
Private Sub DataCombo2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text1(3).SetFocus
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
Private Sub Form_Activate()
DataCombo1.SetFocus
Private Sub Form_Load()
tlbState Toolbar1, False
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'Download by http://www.codefans.net
Private Sub Text1_GotFocus(Index As Integer)
Text1(Index).BackColor = &HFFFF00
Text1(Index).SelStart = 0
Text1(Index).SelLength = Len(Text1(Index))
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn And Index & 7 Then Text1(Index + 1).SetFocus
If KeyCode = vbKeyReturn And Index = 6 Then Text1(7).SetFocus
If KeyCode = vbKeyReturn And Index = 2 Then DataCombo2.SetFocus
Private Sub Text1_LostFocus(Index As Integer)
Text1(Index).BackColor = &H
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "add"
blnAdd = True
tlbState Toolbar1, True
For i = 1 To Text1.UBound
Text1(i) = ""
Text1(i).Locked = False
DataCombo1.Text = "": DataCombo2.Text = ""
DataCombo1.Locked = False: DataCombo2.Locked = False
DataCombo1.SetFocus
Case "modify"
If Adodc1.Recordset.RecordCount & 0 Then
blnAdd = False
tlbState Toolbar1, True
For i = 1 To Text1.UBound
Text1(i).Locked = False
DataCombo1.Locked = False
DataCombo2.Locked = False
MsgBox "系统没有要修改的数据!", , "提示窗口"
Case "delete"
If Adodc1.Recordset.RecordCount & 0 Then
Adodc1.Recordset.Delete
Adodc1.Recordset.Update
MsgBox "系统没有要删除的数据!", , "提示窗口"
Case "save"
If Text1(1).Text = "" Then
MsgBox "系统不允许商品名称为空!", , "提示窗口"
If IsNumeric(Text1(4)) = False Then
MsgBox "请在成本价文本框中输入数字!", , "提示窗口"
If IsNumeric(Text1(5)) = False Then
MsgBox "请在销售价文本框中输入数字!", , "提示窗口"
If IsNumeric(Text1(6)) = False Then
MsgBox "请在库存文本框中输入数字!", , "提示窗口"
'----------------------------防止数据保存时出现运行时错误------------------------------------------
On Error GoTo SaveErr
If blnAdd = True Then
rs1.Open "select * from 商品信息表 where 商品名称='" + Text1(1) + "'and 规格='" + Text1(2) + "'", Cnn, adOpenKeyset
If rs1.RecordCount & 0 Then
MsgBox "此商品已存在!", , "提示窗口"
Cnn.Execute ("insert into 商品信息表(商品类别,商品名称,规格,单位,成本价,销售价,库存数量,备注,存放库位) values('" + DataCombo1 + _
"','" + Text1(1) + "','" + Text1(2) + "','" + Text1(3) + "'," + Text1(4) + "," + Text1(5) + "," + Text1(6) + ",'" + Text1(7) + "','" + DataCombo2 + "')")
Adodc1.Refresh
tlbState Toolbar1, False
For i = 1 To Text1.UBound
Text1(i).Locked = True
DataCombo1.Locked = True: DataCombo2.Locked = True
rs1.Open "select * from 商品信息表 where 商品名称='" + Text1(1) + "'and 规格='" + Text1(2) + "'", Cnn, adOpenKeyset
If rs1.RecordCount & 0 And Text1(1) && DataGrid1.Columns(1) And Text1(2) && DataGrid1.Columns(2) Then
MsgBox "此记录已存在!", , "提示窗口"
Cnn.Execute ("update 商品信息表 set 商品类别 ='" + DataCombo1 + "',商品名称 ='" + Text1(1) + "',规格 ='" + Text1(2) + _
"',单位 ='" + Text1(3) + "',成本价=" + Text1(4) + ",销售价=" + Text1(5) + ",库存数量=" + Text1(6) + ",备注='" + Text1(7) + "',存放库位 ='" + DataCombo2 + "'where 商品名称 ='" + DataGrid1.Columns(1) + _
"'and 规格 ='" + DataGrid1.Columns(2) + "'")
Adodc1.Refresh
tlbState Toolbar1, False
For i = 1 To Text1.UBound
Text1(i).Locked = True
DataCombo1.Locked = True: DataCombo2.Locked = True
MsgBox Err.Description
'--------------------------------------------------------------------------------------------------
Case "cancel"
tlbState Toolbar1, False
For i = 1 To Text1.UBound
Text1(i).Locked = True
DataCombo1.Locked = True: DataCombo2.Locked = True
Case "close"
End Select
所需金币: 4
文件大小:0.04MB
您当前剩余金币:0}

我要回帖

更多关于 数据有效性indirect 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信