Jump to content
Aveyond Studios Community
Sign in to follow this  
Kinnison

Anyone knows VB6?

Recommended Posts

Sorry for a sudden poof in like this, but I kinda desperate to know how do I store information typed from the text box of VB6 to be saved in a form of Microsoft Access File?

 

I mean, I'm looking for the VB6 coding that allows me to do that. I couldn't seem to find one that I can easily use in my software's system. It doesn't have to be in MS access, just as long as I can save the database entered in the software I make without losing everything upon closing the program or the computer.

 

Any help would be appreciated.

Share this post


Link to post
Share on other sites

It's worth a look but it sounds like it needs to connect to some sort of server. Is there a way I can just simply save it in a form of MS Access File?

Share this post


Link to post
Share on other sites

I think to do what you want, you need to have your VB form bound to a specific table in your db. You can certainly do that if your front-end is an Access app. I would think it ought to be possible with a vb app.

 

Otherwise, you will need an update query to take the info from the vb form and store it in the db.

Share this post


Link to post
Share on other sites

Ah, anyway I found a method to store data using Microsoft Words, so there will be a change to the topic. I can say goodbye to this ADO thingy :P

 

Now all I need is how do I insert two words into separate lines?

 

Lets say if I put txtOutput.Text = "ABC" + "DEF" it will display like this:

 

ABCDEF

 

All I want is to display the ABC and DEF in two separate lines like this in the MultiLine textbox:

 

ABC

DEF

 

How do I do that?

Share this post


Link to post
Share on other sites

Well... presuming your text box can handle multiple lines you need to concatenate your strings with a line break character. I would try something like

 

txtOutput.Text = "ABC" & vbCrLf & "DEF"

 

vbCrLf is a VB constant that puts in a carriage return line feed.

Share this post


Link to post
Share on other sites

One more thing I almost forgot to ask, is it possible for me to retain all the changes I made in the .exe application?

Like my application is full of button and its availability is indicated by green and red colors.

The default buttons' are green when the application starts up and let say I clicked some of them to make them goes red, how can I make them stay red when I close the application and open it again some other time? Is that possible?

Share this post


Link to post
Share on other sites

It should be, but you will probably need to store that info in the database. There may be built-in tools (like cookies on the web) for something like that I don't know about (I do a lot of work in VB6, but not for desktop applications (.exe)).

 

So here's what occurs to me: create a hidden checkbox for each button (these would be yes/no fields in the database). It would default to unchecked. When the user clicks on a button it would check the hidden checkbox. The formatting for the button would depend on the checkbox (green if unchecked, red if checked). As long as the checkboxes are reading from and updating the database, that should do it.

Share this post


Link to post
Share on other sites

What if I use the Boolean variable (The one with true/false) in place of checkboxes? Can they be stored in the database?

 

I was thinking of having my VB6 application able to save and load together but for now I was only able to make it save into MS Word and not be able to load back into the application's variables and all.

Share this post


Link to post
Share on other sites

The boolean variable is fine (all of my front-end design is form-based, so I tend to think in terms of checkboxes).

 

You can certainly store a boolean field in the database (I believe in Access the boolean type is called yes/no). But if you aren't able to load any data back into your app it's not going to do you any good.

Share this post


Link to post
Share on other sites

Yea, I consulted my project supervisor today and she said it's illogical if I didn't load anything back to the application.

 

Ah, anyway I found a unique way to save and load the variables. I have each of the arrays listed up in a row in a textbox and use a different extension, then when I load I'll be loading them in a listbox then set a conditional branch afterward to sort out and assign each line of the textbox to the variables.

 

Well, I have you to thank this for. :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...