Reg:我的输出在哪里?按下运行按钮后 [英] Reg: Where is My Output? after Pressing the run button

查看:58
本文介绍了Reg:我的输出在哪里?按下运行按钮后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...


我使用的是Visual Basic 6.0版本...正如我在上一篇文章中所说的那样,我对Visual Basic非常陌生并且在编程方面知识匮乏...我已经在其中完成了一个小程序从Mysql数据库中提取特定数据...在程序中我已经选择了一个OK按钮,并且我已经编写了一些代码行来提取数据...我想如果我在输出中按下OK按钮,我将获得提取数据的列表...但是即使在按下确定按钮之后也没有任何显示屏幕保持不动...你能帮助我吗? 。这是程序
如果我在Visual Basic中使用数据库,是否有必要提供一些插件...如何提供?


选项明确

''>>>>>>>>>>>>> ;>>>>>>>>>>>


Const BUTTON1 ="& OK"


''>>>> >>>>>>>>>>>>>>>>>>>>>>>>


Private Sub Okbutton_Click()


Dim sConnect As String

Dim db As 数据库

Dim rs As Recordset

Dim doubleID As Double

Dim doubleID1 As Double

Dim intstring As String


sConnect =" ODBC; DSN = WinUTMS_RT_DB; UID = Localhost; PWD =;数据库e = WinUTMS_RT_DB;"


设置db = gwsMainWS.OpenDatabase( "",0,0,sConnect)


设置rs = db.OpenRecordset(" SELECT Messwert,UPLimWert FROM abssubtest,其中Messwert LIKE")

Do while not rs.EOF

doubleID = rs!Messwert

doubleID1 = rs!UPLimWert

intstring = rs.Fields(1)

rs.MoveNext

循环

结束Sub

快速回复将非常有帮助对我来说


感谢和问候
Siva

解决方案

你所做的只是打开一个数据库,读取它并将其存储在一个变量中(实际上你要覆盖变量)在你的do while循环中)..你必须使用某种输出动作/命令,如msgbox,或者你可以在一个文本文件等中写出你的输出。

试着写...

msgbox" doubleID:" &安培; doubleID& vbnewline& doubleID1: &安培; doubleID1& vbnewline& intstring: &安培; intstring
你的do while循环中的


你没有做任何事情来在你的代码中获得任何输出。


< blockquote>我收到编译错误


用户定义的类型未定义

,按下确定后,光标将转到 Dim db As Database 。在程序中....


它可能是因为库文件...你能告诉我如何为数据库添加库文件....如果不是什么可能是


的原因

Hi everyone...

I am using Visual basic 6.0 version...as I said in the previous thread I am very much new to Visual basic and poor knowledge in programming...I have done a small program in it to extract a particular data from the database of Mysql...In the program I have taken a OK button and in that I have written some lines of code to extract the data...I thought if I press OK button in the output I will get the list of the extracted data...but there is nothing displaying even after pressing the Ok button the screen stay''s still...can you help me in this..This is the program
Is it necessary to give some plug-ins if I am using database in Visual basic..if so how to give that?

Option Explicit
''>>>>>>>>>>>>>>>>>>>>>>>

Const BUTTON1 = "&OK"

''>>>>>>>>>>>>>>>>>>>>>>>

Private Sub Okbutton_Click()

Dim sConnect As String
Dim db As Database
Dim rs As Recordset
Dim doubleID As Double
Dim doubleID1 As Double
Dim intstring As String

sConnect = "ODBC;DSN=WinUTMS_RT_DB;UID=Localhost;PWD=;Databas e=WinUTMS_RT_DB;"

Set db = gwsMainWS.OpenDatabase("", 0, 0, sConnect)

Set rs = db.OpenRecordset("SELECT Messwert, UPLimWert FROM abssubtest where Messwert LIKE ")
Do While Not rs.EOF
doubleID = rs!Messwert
doubleID1 = rs!UPLimWert
intstring = rs.Fields(1)
rs.MoveNext
Loop
End Sub

Fast reply will be really helpfull for me

Thanks and regards
Siva

解决方案

What you have done is just open a database,read it and store it in a variable(actually you are overwriting the variable in your do while loop)..you must have to use some sort of output actions/commands like msgbox or you can write your output in a text file etc..
try writing..
msgbox "doubleID: " & doubleID & vbnewline & "doubleID1: " & doubleID1 & vbnewline & "intstring: " & intstring
inside your do while loop.


you have done nothing to get any output on the screen in your code.


I am getting a compile error

"User-defined type not defined"
and after pressing Ok, the cursor is going to "Dim db As Database" in the program....

it may be because of the library files...can you tell me how to add the library files for the database....if not what might be the reason


这篇关于Reg:我的输出在哪里?按下运行按钮后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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