debasisdas 580 Posting Genius Featured Poster

what about file name ?

debasisdas 580 Posting Genius Featured Poster

Requirement is not clear.

debasisdas 580 Posting Genius Featured Poster

How you set which file to play using the control ?

debasisdas 580 Posting Genius Featured Poster

The solution is here.

debasisdas 580 Posting Genius Featured Poster

Experience can not be explained.

debasisdas 580 Posting Genius Featured Poster

From VB use ADO to connenct to database.

Please find the connection string here.

debasisdas 580 Posting Genius Featured Poster

let see the code that you are working on.

debasisdas 580 Posting Genius Featured Poster

ADODC is not a database, it is a control to connect to database.

use ADODB and try this code

cn.begintrans  ' cn--adodb connection object
cn.execute "your update command goes here"
cn.committrans
debasisdas 580 Posting Genius Featured Poster

What is the problem if you store the complete date, you can always display only the month and year part for any reporting. You can't store 00 as a date value.

Another option is to store the month and year values as string not dated.

debasisdas 580 Posting Genius Featured Poster

Welcome aboard.

debasisdas 580 Posting Genius Featured Poster

Welcome aboard.

debasisdas 580 Posting Genius Featured Poster

What is the expected result ?

debasisdas 580 Posting Genius Featured Poster

you need to join both the tables based on room id.

debasisdas 580 Posting Genius Featured Poster

You need maintain two separate tables, one for rooms information and another for bookings information.

debasisdas 580 Posting Genius Featured Poster

Welcome aboard.

debasisdas 580 Posting Genius Featured Poster

nope :)

What nope ?

debasisdas 580 Posting Genius Featured Poster

If it is one value or more always better to store securely , preferable in DB.

debasisdas 580 Posting Genius Featured Poster

What about using database for the purpose.

debasisdas 580 Posting Genius Featured Poster

No a separate table for booking information , there you need to store room number with booking start and end time with date.

debasisdas 580 Posting Genius Featured Poster

Check for proper syntax in your code.

Are you storing the username and password in database ?

debasisdas 580 Posting Genius Featured Poster

Not necessarily. the status of the room will be availble before 09:45 and after 11:15.

It will be occupied during 09:45 - 11:15 only.

You need to maintain separate tables for rooms and rooms bookings.

debasisdas 580 Posting Genius Featured Poster

What exactly you are trying to do ?

debasisdas 580 Posting Genius Featured Poster

Have you tried as i suggested in my previous post ?

debasisdas 580 Posting Genius Featured Poster

then go and read books.

debasisdas 580 Posting Genius Featured Poster

Start crying louder, that may help.

That is what school kids do when they are not spoon feed.

debasisdas 580 Posting Genius Featured Poster

i don't you have started writing a single line of code yet.

debasisdas 580 Posting Genius Featured Poster

Hi Cliff,

Welcome to Daniweb.

debasisdas 580 Posting Genius Featured Poster

You need to read books for all those details.

debasisdas 580 Posting Genius Featured Poster

sorry duplicate

debasisdas 580 Posting Genius Featured Poster

Please follow this procedure.

1. Collect all the code that you can find over net.
2. Put in a mixi
3. Run the mixer for 4 and 1/2 minutes (preciously)
4. Add chocolate cream with a shot of citrus juice.
5. Serve your friends chilled,

all your friends will be impressed with your code mixing skills.

adam_k commented: :D +6
stbuchok commented: Thank you, you made my day. +7
Reverend Jim commented: Genius. How did I miss this gem the first time round? +12
debasisdas 580 Posting Genius Featured Poster

All the rooms will be part of a single table.

The flag needs to be set to available when ever it is available, occupied otherwise.

debasisdas 580 Posting Genius Featured Poster

Consider this and check if this suits your requirement.

Tables structure

Person
(id,
name,
field3,
field4,
..........
static_energy,
se_status)

1. Initially insert al other details into the Person table except statis_energy column and set the se_status to 0.
2. when the external process runs creat the output into a text file with name same as ID of the person and update the status in the table to 1.
continue this process for all other person details.
3. Run a procedure to read the text file and update the static_energy column of the corresponding record (based on ID).

debasisdas 580 Posting Genius Featured Poster

Is that being stored anywhere in the DB ?

debasisdas 580 Posting Genius Featured Poster

How the application knows what is the status of the execution of external process ?

Are you setting any flag ?

debasisdas 580 Posting Genius Featured Poster

Generally how you determine if the external process executed properly or not ?

debasisdas 580 Posting Genius Featured Poster

Are you going to insert every thing from the text file into a table or update a single field of a table based on data in text file ?

debasisdas 580 Posting Genius Featured Poster

which part you are struck up with ?

1. read the content from the text file.
2. write to database.

it should be that simple.

debasisdas 580 Posting Genius Featured Poster

First of all tell me from where you got VB 6.5 ? Is it a home grown version ? ;)

1. Use ADO (refer to ADODB library).
2. Open recordset using desired SQL.
3. Populate the controls from recordset.

debasisdas 580 Posting Genius Featured Poster

What is the differnece between Returndate and Receivedate ?

No need to store TotalDays in the DB table, it can be calculated at run time for any requirement like reporting.

debasisdas 580 Posting Genius Featured Poster

Please teach me step-by-step

You need to read books for all that.

debasisdas 580 Posting Genius Featured Poster

What exactly you are trying to do ?

debasisdas 580 Posting Genius Featured Poster

welcome aboard.

debasisdas 580 Posting Genius Featured Poster

welcome aboard.

debasisdas 580 Posting Genius Featured Poster

use 2 recordset object
open one with the count query and check the data in DB.

If it returns 0(that means the userid does not exists in the DB) then open the other recordset to insert new records.

If it returns 1(that means the userid already exists in the DB) prompt the user for new userid, password and then then open the other recordset to insert new records.

debasisdas 580 Posting Genius Featured Poster

Try this sample code.

Dim cn As New ADODB.connection
 
cn.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "\data\DataBaseName.mdb"

cn.BeginTrans
cn.Execute "your insert statement goes here."
cn.CommitTrans
debasisdas 580 Posting Genius Featured Poster

What is the code that you are working on ?

debasisdas 580 Posting Genius Featured Poster

To display data from database in the VB forms you need to open recordset and populate the controls.

Try this sample code.

Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim str As String

cn.open "your connectionstring here"
 
str = "SELECT Field1 FROM Table1"
rs.CursorLocation = adUseClient
rs.Open str, conn, adOpenStatic, adLockOptimistic
 
Text1.Text = rs("Field1")
 
rs.Close

You need to check for BOF and EOF also.

debasisdas 580 Posting Genius Featured Poster

There is no generic answer to this.

A lot will depend on how you have installed and configured the DB.

During installation it is compulsory to set password for SYS and SYSTEM account. Again you can unlock and set password for other preexisting accounts (SCOTT is one of them) which is not compulsory during installation and can be done later by logging in from either of SYS or SYSTEM accounts.

So to log in into SYS or SYSTEM accounts, you need to login with the password that you have set (which you only know) during installation process.

debasisdas 580 Posting Genius Featured Poster

God is the best imagination of man.

debasisdas 580 Posting Genius Featured Poster

Test using some sample data you will come to know.