|
I'm checking it out, looks like what I need.
Many thanks for your help,
Glen Conaway
|
|
|
|
|
The simplest way i can think of is to have a boolean flag at each end like this inside of a do loop so it keeps checking.
This way will mean it will only process if it is not processing and it will keep checking until blnProcessing becomes false again if you get what i mean
Private Sub SavePosition()
Dim blnProcessing as boolean
Do while 1 = 1
if blnprocessing = false then
blnProcessing = true
' Creating stream Writer type object
Dim SW As StreamWriter
' Create FS As FileStream
Dim Fs As FileStream
' Creating steam.txt using filestream object and reference
' to filestream object
Fs = New FileStream("C:\stream2.txt", FileMode.Create)
' Initializing steam reader object using filesteam object
SW = New StreamWriter(Fs)
' Saving data to file
SW.WriteLine(ListBox1.SelectedIndex)
' Closeing stream writer
SW.Close()
' Closeing file stream
Fs.Close()
blnProcessing = false
exit do
End if
wend
End Sub
"I am what i am, and i do what i do, but sometimes i do, what you want me to do."
|
|
|
|
|
Your question is very vague. Are you retrieving data from an SQL database, Access database, XML file, a WebService, ... You'll have to be a bit more specific as to what you're trying to do.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
For VB
Check
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdprofilterx.asp
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
This is my code
------------------------------------
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 39 Then
Image1.Left = Image1.Left + 50
End If
If KeyCode = 37 Then
Image1.Left = Image1.Left - 50
End If
If KeyCode = 40 Then
Image1.Top = Image1.Top + 50
End If
If KeyCode = 38 Then
Image1.Top = Image1.Top - 50
End If
End Sub
Private Sub Timer1_Timer()
If Image1.Top = Shape1.Top And Image1.Left = Shape1.Left Then
MsgBox "Touch"
End If
End Sub
--------------------
My Problem is:
I want to fire the events If the Image1 touch any edge of the shape1.
|
|
|
|
|
Raise what event? Are you asking how you can define your own custom event and fire it?
You have to declare an event to fire first, something like this at the module level, class level, or form:
Public Event MyEvent(MyArg1 As Integer)
And you fire it like this:
RaiseEvent MyEvent(someValue)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I just developed access database application, I store the table in one file and form (interface) in another file. I do like this because I want to protect the source data from unauthorize access from the other people. I have a problem when I want to present data to a report. The report always ask for the table and the field when I need to drage its control on the report design space. I want to know the way that could pass the value from the first database file to the report in the second database file. Please help me
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
If your going to use two databases like this and want to use the designers, you'll have to create a table link to the other database and treat it like an external data source. Only then will you be able to use the report designers to visually put the report together.
In Access, you haven't protected the data by putting it is a seperate file. All you've done is make it more difficult to write the code to use it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yes, import table is my final step that I used to solve the problem. But I don't want to do that. Wheter the table are link to the other mdb file but it seem that it store in the same file because any one can view its data. What i want to do is store the table and form, report in a difference file and link it together by using the code. Do you have any sugesstion?
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Yes. Access isn't designed to do that! It's a desktop database for simple database solutions. It wasn't designed to do what you want. If you want the data seperate from the presentation and business logic code, you're going to have to move it to either an MSDE or SQL Server solution.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi All,
I facing some problem in the write data to the database file. Basically, i want to write the data after i read it from text file(aa.txt), and then want to compare the databasr file with the orginal text file.
for example,
"comcode(0) = &H10
res = aa_i2c_read(aardvark, slave, 5, comcode(1), AA_I2C_NO_FLAGS)
s = Str(comcode(1)) + Str(comcode(2))"
I want the Str(comcode(1)) write to the database in low 1, and the Str(comcode(2)) in low 2 in the same database.
After finish write to the database, i want to compare the low by low with the original text file (aa.txt).
Anyone can give some exmple coding to solve this problem?
thanks.
|
|
|
|
|
hi there!i just want to ask if you can provide me or give me sample source code on how to select the datas from database to excel wherein the equivalent relaycode of relay monitoring data(relaycodes and their equivalent relay are in the database) will be put on the worksheet where the pivoted datas are. datas are already summed up using pivot table and in the sheet1(for example) of the worksheet.the problem s,how will i able to put the equivalent relaycodes in the sheet1 where the summed up datas are? please i really need your help..tnx
|
|
|
|
|
I try to debug, but to some extend, sometimes this error do occurs.
But sometimes it doesn't. I get this error, when i click on one of the graphs (which query the database), the result sets will repaint the graph and update itself. Any ideas why this happen ? Here's the error description..
AppName: msaccess.exe
AppVer: 11.0.5614.0
AppStamp:3f3c8e3c
ModName:owc10.dll
ModVer:10.0.5605.0
ModStamp:3f2eb3be
fDebug
Offset: 000efbd1
|
|
|
|
|
That's not an error. What you posted was a description of Access when it crashed. We need every word of the actual error message.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That is the problem.
There isn't any actual error, which I find this very hard to debug.
Which is why I said, sometimes it crash and sometimes it doesn't.
Here's the behaviour from what I observed.
I basically retrieve data from the database, while retrieving, I Repaint the graph (Line chart). To my understanding, if the data takes longer to retrieve, it then have enough time to draw the graph as it moves along. But on some occasions, datasets are small, and it's done retrieving, but the front end doesn't have enough time to rePaint the chart. So any help I get is truly appreciated. I've been sleeping thinking about this day and night...
The program just crashed...
|
|
|
|
|
Without seeing any code, it's going to be impossible to tell you want may be wrong.
How are you drawing the Graph? 3rd party control? MSGRAPH?
I haven't found any information in the MS KB articles about a problem like this in Access...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm using the OWC10.ChartSpace object to draw my charts.
It's being referenced to the OWC10.dll file.
|
|
|
|
|
Any code to go with that?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello everyone,
I have been working on a Tic Tac Toe program off and on over the last few weeks. I am at a point where I need to add a save and load ability for high scores. I have no idea where to look to learn about saving your game or program - how to do it with a dialog or without a dialog box. If there is any documentation that could teach me how to program a save and load feature in my tic tac toe program - and other programs coming in the future - that would be awesome.
Thank you all!
~Achithyn
Version of software: Visual Basic .NET 2003
|
|
|
|
|
oops, just to let everyone know, that was me :S lol - Must have cleared my cookies since the last time I was here. Thanks in advance for any help you may have!
~Achithyn
|
|
|
|
|
Here is the problem: i try to fire an event from an imageButton created dynamically. But the compiler won't let me do it.
It springs an error: 'Public Event Click(sender As Object, e As System.Web.UI.ImageClickEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
I have seen it done in C#. Is there a VB.net solution? Simplified code below:
imports System
Imports System.Web.UI
Imports System.Web.UI.Webcontrols
public class domClss : Inherits System.Web.UI.Page
public myTable As System.Web.UI.WebControls.Table
sub Page_load(s as System.object, e as System.eventArgs) Handles mybase.load
if NOT page.isPostBack then
dim r as new TableRow()
dim c as new TableCell()
dim b as new System.Web.UI.WebControls.imageButton()
b.click = new System.Web.UI.ImageClickEventHandler(b_Click)
c.controls.add(b)
r.cells.add(c)
myTable.rows.add(r)
End if
End sub
Private void b_click(sender As System.Object, e As System.ImageClickEventArgs)
response.write ("button clicked")
end sub
End class
I certainly would appreciate some light on the problem.
Thanks in anticipation
Pyb
|
|
|
|
|
Changes to
Public myTable As New System.Web.UI.WebControls.Table
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
Dim r As New TableRow
Dim c As New TableCell
Dim b As New System.Web.UI.WebControls.ImageButton
AddHandler b.Click, AddressOf b_Click
c.Controls.Add(b)
r.Cells.Add(c)
myTable.Rows.Add(r)
End If
End Sub
Private Sub b_click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)
Response.Write("button clicked")
End Sub
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
Hi Sanjay,
That "addhandler ..." line made all the difference. After some tidying up, it all works like a charm. Great stuff, thanks for your help, you're a champ.
Obviously the way I saw it operate in C# is quite different. It seems that VB.Net is not the exact carbon copy of C# I thought it might be. By the way, which of these two languages would you say is the most useful?
Cheers,
Pyb
|
|
|
|
|
I am trying to use MATLAB for its graphing capabilities, and need to write a .MAT file using visual basic. How can i do this, or where can i find info to do this? thank you. this may be a very basic question, but i am an amatuer programmer, so any info will help.
|
|
|
|
|
murphypa wrote:
How can i do this, or where can i find info to do this?
You can google for MATLAB File Format[^]
The first entry in the search result looks like what you are looking for.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|