debasisdas 580 Posting Genius Featured Poster

you need to open the recordset with multiple columns and then to add to the list box try this

list1.additem (rs(0)&"  " & rs(1) & "  " & rs(2))
debasisdas 580 Posting Genius Featured Poster

You only need to change the connection string to access the database.

There would hardly be any changes to your VB code for MySQL.

debasisdas 580 Posting Genius Featured Poster

i have added the .addnew method to look like the following but it now ads a new row with blank fields and only one field at the end.

that is because you have assigned value only for one field (copiesremaining) not for others.

debasisdas 580 Posting Genius Featured Poster

You need to call AddNew or Edit method before calling Update.

debasisdas 580 Posting Genius Featured Poster

do post back in case of any issues.

debasisdas 580 Posting Genius Featured Poster

you can't assign an entire recordset to a textbox. You need to fetch one field of a record and display the same in the textbox.

debasisdas 580 Posting Genius Featured Poster

You need to handle the ascii value of the keys on keypress event of the control.

debasisdas 580 Posting Genius Featured Poster

Please pass more info , which control you are using ? how you make those cartoons ?

debasisdas 580 Posting Genius Featured Poster

what is the database that you are using ?

debasisdas 580 Posting Genius Featured Poster

Try to use a procedure to insert the records into the database.

Try this sample oracle code.(convert to sql server code as per your requirement)

create or replace procedure find(eno number, flag out boolean)
is
a number(2);
begin
select count(*) into a from emp where empno=eno;
if a=0 then
flag:=FALSE;
else
flag:=TRUE;
end if;
end;
/


create or replace procedure ins_emp(a number)
is
eno emp.empno%type;
fg boolean;
begin
eno:=a;
<<abc>>
find(eno,fg);
if fg=true then
dbms_output.put_line(eno||'  No already exists...');
eno := eno+1;
goto abc;
else
insert into emp(empno) values(eno);
dbms_output.put_line('New empno inserted is : '||eno);
end if;
end;
/
debasisdas 580 Posting Genius Featured Poster

That is not the way to work with databases. If you want to avoid gaps then just follow post #2. But that is not going to fulfill your requirement of deleted records.

debasisdas 580 Posting Genius Featured Poster

Find out the max value of the field and add 1 to generate the new value.

debasisdas 580 Posting Genius Featured Poster

Please post your code that you are working on. Our experts will advice you to improve the same. Don't expect the complete code.

debasisdas 580 Posting Genius Featured Poster

the first one uses client side cursor.

debasisdas 580 Posting Genius Featured Poster

There are different ways to connect to database.

you can either you code or components.

try using ADO or DAO.

What is the database that you are using.

debasisdas 580 Posting Genius Featured Poster

Then you need to try this.

TOAD does not come in that price range.

debasisdas 580 Posting Genius Featured Poster

you need to copy the activex component also to the system and register that using REGSVR32 command.

debasisdas 580 Posting Genius Featured Poster

How much you are ready to invest for the tool ?

debasisdas 580 Posting Genius Featured Poster

What happens when you call the function / event in Form_Resize event ?

Is that not getting executed ?

debasisdas 580 Posting Genius Featured Poster

Relational modeling is the logical representation of the physical relation of the DB tables.

debasisdas 580 Posting Genius Featured Poster

if you are ready to pay use TOAD or PLSQL DEVELOPER, the best possible tools in market.

debasisdas 580 Posting Genius Featured Poster

try the following code, make changes as desired

Dim CN As New ADODB.Connection
Dim RS As ADODB.Recordset
Dim DataFile As Integer, Fl As Long, Chunks As Integer
Dim Fragment As Integer, Chunk() As Byte, i As Integer, FileName As String

Private Const ChunkSize As Integer = 16384
Private Const conChunkSize = 100

Private Sub cmdSave_Click()
    CN.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Pubs;Data Source=Test"
    Dim strSQL As String

    strSQL = "SELECT * FROM pub_info where pub_id = '9999'"
    RS.Open strSQL, CN, adOpenForwardOnly, adLockOptimistic

    RS.AddNew
      SavePicture
    RS.Update

    Set RS = Nothing
    Set RS = New Recordset
End Sub

Private Sub SavePicture()
    Dim strFileNm As String
    DataFile = 1
    Open strFileNm For Binary Access Read As DataFile
        Fl = LOF(DataFile)   ' Length of data in file
        If Fl = 0 Then Close DataFile: Exit Sub
        Chunks = Fl \ ChunkSize
        Fragment = Fl Mod ChunkSize
        ReDim Chunk(Fragment)
        Get DataFile, , Chunk()
        RS!logo.AppendChunk Chunk()
        ReDim Chunk(ChunkSize)
        For i = 1 To Chunks
            Get DataFile, , Chunk()
            RS!logo.AppendChunk Chunk()
        Next i
    Close DataFile
End Sub
debasisdas 580 Posting Genius Featured Poster

that has nothing to do with database connection . check your other code.

debasisdas 580 Posting Genius Featured Poster

you should get correct output with your code. there is nothing wrong with it.

debasisdas 580 Posting Genius Featured Poster

You can't disable the windows key.

debasisdas 580 Posting Genius Featured Poster

i don't understand your logic of authentication.

How Select * from Users ensures that the user id exists and the password entered matches with that stored in DB ?

debasisdas 580 Posting Genius Featured Poster

what is the source of data in the control ? is it getting populated from database ?

debasisdas 580 Posting Genius Featured Poster

* is not required in delete statement. use this

strSQL = "DELETE FROM Product WHERE Expiry_Date = '" & Text1.Text & "'"

debasisdas 580 Posting Genius Featured Poster

Try the following sample code.

SELECT code,substr(code,instr(code,'-',1)+1,2) from table_name;
debasisdas 580 Posting Genius Featured Poster

but it will be impossible to create as many number of text boxes as number of records grows in the database

debasisdas 580 Posting Genius Featured Poster

but where is the loop in your code ?

debasisdas 580 Posting Genius Featured Poster

you want to create a group of textbox for each Id ?

debasisdas 580 Posting Genius Featured Poster

is that crystal report or data report ?

debasisdas 580 Posting Genius Featured Poster

i don't see and disadvantages.

debasisdas 580 Posting Genius Featured Poster

you nee to create a table with check constraint and default values.

try this

create TABLE table1 
(ID INT,
status varchar2(10) DEFAULT 'Available',
CONSTRAINT con_chk1 CHECK (status IN ('Available','Unavailable','CheckedOut')
))
debasisdas 580 Posting Genius Featured Poster

the syntax that you are using is not Oracle syntax.

debasisdas 580 Posting Genius Featured Poster

You need to pass more information.

debasisdas 580 Posting Genius Featured Poster

What do you mean by when an exe is ended ?

debasisdas 580 Posting Genius Featured Poster

There are many applications that can be finished in your time frame. Now it depends on you what you decide to develop.

debasisdas 580 Posting Genius Featured Poster

If you are looking for the connection string find it here.

from vb 6.0 you need to use ADO.

debasisdas 580 Posting Genius Featured Poster

you do not need an intermediate table only defining the relationship by PK and FK will do that for you. But from your post i am not use what exactly you are looking for. I think you need to pass more information.

debasisdas 580 Posting Genius Featured Poster

try this sample function for the job.

Code:
Public Function NumToWord(numstr As Variant) As String

Dim newstr As String

numstr = CDec(numstr)

If numstr = 0 Then
NumToWord = "Zero"
Exit Function
End If

If numstr > 10 ^ 24 Then
NumToWord = "Number too big"
Exit Function
End If

If numstr >= 10 ^ 12 Then
newstr = NumToWord(Int(numstr / 10 ^ 12))
numstr = ((numstr / 10 ^ 12) - _
Int(numstr / 10 ^ 12)) * 10 ^ 12
If numstr = 0 Then
tempstr = tempstr & newstr & "Bilion "
Else
tempstr = tempstr & newstr & "Bilion "
End If
End If

If numstr >= 10 ^ 6 Then
newstr = NumToWord(Int(numstr / 10 ^ 6))
numstr = ((numstr / 10 ^ 6) - _
Int(numstr / 10 ^ 6)) * 10 ^ 6
If numstr = 0 Then
tempstr = tempstr & newstr & "milion "
Else
tempstr = tempstr & newstr & "milion "
End If
End If

If numstr >= 10 ^ 3 Then ' thousand
newstr = NumToWord(Int(numstr / 10 ^ 3))
numstr = ((numstr / 10 ^ 3) - Int(numstr / 10 ^ 3)) * 10 ^ 3
If numstr = 0 Then
tempstr = tempstr & newstr & "thousand "
Else
tempstr = tempstr & newstr & "thousand "
End If
End If

If numstr >= 10 ^ 2 Then
newstr = NumToWord(Int(numstr / 10 ^ 2))
numstr = ((numstr / 10 ^ 2) - Int(numstr / …
debasisdas 580 Posting Genius Featured Poster

You need to work with CDO.

debasisdas 580 Posting Genius Featured Poster

i didn't understand your question .

What is a forum window ?
What do you mean by update without saving ?

debasisdas 580 Posting Genius Featured Poster

From your post i became a bit curious and tried to trace back my old days here.

My first post was in community introduction section here, as i was trying to post a brief intro of self ,as per the couple of stickies in that section,just to complete formalities ,before being bombarded with questions a lot via PM from oracle and VB 6 forums.

And surprisingly i have started only one other thread Thoughts of the day ,which has over whelming response from members with 1300+ posts.

That simply means i have never asked any question and always replied to others queries/doubts.

So i am going to pat myself on the back the entire evening.

Ancient Dragon commented: Good Job :) :) +36
debasisdas 580 Posting Genius Featured Poster

comment Unload Me in your code and i hope the rest wills tart working. use Me.Hide instead of unload Me.

debasisdas 580 Posting Genius Featured Poster

You need to format the date to proper format before pasing the same to database.

debasisdas 580 Posting Genius Featured Poster

what is that CON in your code ?

What type of object is that ?

debasisdas 580 Posting Genius Featured Poster

Are you using ADO to connect to the database ?

debasisdas 580 Posting Genius Featured Poster

then you need to populate records from the source to a staging (intermediate) table before actually inserting them to your main table.

so with each load you need to truncate your table and load only the required records.