一个新手Access数据库问题 [英] A newbie Access database question

查看:77
本文介绍了一个新手Access数据库问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能帮忙吗?.
这段代码可以正常工作.但是,仅当文本框中包含文本"时.

如果一个或两个文本框中都包含数字,如何使它正常工作. ??

Can anyone please help ?.
This code works fine.However only if the textbox''s have "Text" in them.

How can I get it to work if one, or both textbox''s have a Number in them. ??

Where  ( Track=''" & TextBox1.Text & "'' ) AND ( Distance = ''" &  TextBox1.Text & "'' ) </big>

推荐答案

SQL问题的答案是,不要在数字前后加上引号.

您遇到的第二个问题(除了变量名,但我假设您正在玩),您永远不要构建这样的SQL,因为它允许任何用户访问和擦除您的数据库.我建议如果您打算随时编写商业代码,请阅读SQL注入.
The answer to your SQL question is, don''t put quotes around a number.

The second problem you have ( apart from variable names, but I assume you are playing ), is that you should never build SQL like this, because it allows any user to access and erase your database. I suggest if you intend to write commercial code at any point, you read up on SQL Injection.


这篇关于一个新手Access数据库问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆