choudhuryshouvi 33 Posting Pro

ok i 've attached a sample application built on an access database.
run this code and check whether it helps you.

if it is then don't forget to forward me your feedback otherwise if u got any more problem re-post those again.

good luck

regards
Shouvik

choudhuryshouvi 33 Posting Pro

you have posted your thread in wrong forum.
this forum is intended to visual basic 6 only.

move your thread from here and re-post it in vb.net forum. then only your question will be answered.

hope you got it.

choudhuryshouvi 33 Posting Pro

why are you thinking about leaving? if you have decided to learn then just do it. don't be confused we are all here to help you.

ok you have installed the server db. yes there is no hard n fast formalities to start the server and client parts. it will be handled by your os. now to start with sql server you can navigate from sql server management studio. previous versions of sql servers have two separate applications; sql server query analyzer and sql server enterprise manager. but now microsoft has combined both of these into a single one. the sql server management studio is the place where u can control your server database. you can create database, security logins or users, configure the user with a default db, create views which can be used to call reports from ur applications, write procedures, triggers and many more things. in short this management studio is the heart of sql server 2005.

now to get started with this you have to consult a good book.
Visit here to get some online books

Check this on how to connect a sql server 2005 database from visual basic 6

study these books to get some basics.
when you get these get back and i'll give you some more stuffs.

ok........
till then bye

regards
Shouvik

choudhuryshouvi 33 Posting Pro

DataGrid1.Row

choudhuryshouvi 33 Posting Pro

thanks for supporting

choudhuryshouvi 33 Posting Pro

check out this sample and tell me what's your feedback

regards
Shouvik

choudhuryshouvi 33 Posting Pro

listbox1.items.add(""+Serial Number+"")

the above syntax is for adding an element in a listbox from the .NET environment.
there is no such member "Item" exists inside the library of methods for listbox in vb6.

and one more thing, your description is not to the point.
will you mind in making it more clear so that others can understand it and help u?

hope u'll

regards
Shouvik

choudhuryshouvi 33 Posting Pro

proper server databases refer to sql server & oracle databases. though an access database can also be used in this purpose but it is treated as a local database. well the license of the server db that u wish to use completely depends upon the policy of the vendor. but if u wish to use access then u can download a free edition of ms-office from microsoft's download centre. but in case of sql server i think there is no free version available. also u can get a free copy oracle server db from oracle's site. they are offering 10G now (the latest of all oracle databases). so the decision is yours.

if u want to use an access db then u have to do nothing bigger while implementing the same. just put the database in a LAN and install ur application in a server machine. if u use a peer-to-peer connection then u can treat each node as a server connected into the network. then create a shortcut of the application resides in the server machine to each of other nodes available. then run ur apps and do manipulating data. the application will update the same database residing into the server node.

if u use a sql server or an oracle database then the method of implementation is quiet different. u have to install separate copies of ur application into each node and also install the database in each machine. remember that a copy of the server …

choudhuryshouvi 33 Posting Pro

thanks to all of you.
its a pleasure that i have been useful in solving your doubts.

good luck
hv a nice day
bye

choudhuryshouvi 33 Posting Pro

sir shouvi!!! ur code is Great!!!

i does solve my prob, ty soo much,

but before i end this post , on your code,
there are part of it i cant understan (the code's meaning and use)
it my 1st time encountering this part of the code:?:

-Me.Controls (does this point for the objects in the form to?? like ,Dim ctlControl As Object)
-DoEvents (umm.. where is the event? umm..where it start?)
-ReDim Preserve x(c) (does it preserve all values put on dim C?? cnt understand d logic)

-For i = LBound(x) To UBound(x) - 1 Step 1
(also how to read this in logic)

pls?? wanna learn this part really, :-/

jx_man ty for the help and ideas too,,

ok
i am solving one by one. this is going to be a long post. plz hv patience when u read it.

your first question :- Me.Controls (does this point for the objects in the form to?? like ,Dim ctlControl As Object)

Answer : quiet so but not the same as ctlcontrol. here ctlcontrol is just an instance of the object type. as the code is dynamic (capable to encounter every textboxes without bothering how many r there) how could it do that?
notice this line : for each ctlcontrol in me.controls
this line is telling the compiler to iterate through each objects represented as controls in the current form and if the currently scanned object is a textbox then …

choudhuryshouvi 33 Posting Pro

you are welcome

choudhuryshouvi 33 Posting Pro

yes i have done a lot of this. but the method of implementation differs on database type.
so in which type of database you want your demonstration?
this can be done using access,sql server and oracle.

let me know what is your's choice.

bye

choudhuryshouvi 33 Posting Pro

check this sample and give your feedback

regards
Shouvik

Sawamura commented: Great :) +1
choudhuryshouvi 33 Posting Pro

put the running total fld in page footer section.

for grand total insert another running total fld by summing the page total fld and insert it into report footer section.

hope this works.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

you can also use an external utility to send messages through a network.
use the "net" utility.
from vb u can use it with the shell function

for example :-

shell "net send server hello world"

where "server" is the name of the remote computer you are trying to send message and "heelo world" is the msg to be sent.

mind that this utility works in winxp platform only.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

ok by implementing this logic i've not meant that others methods are not workable. no i'm not saying that at all.

you saw that i didn't underestimate any one coz i respect all of u guys.

have a nice day

regards
Shouvik

choudhuryshouvi 33 Posting Pro

if u wish to learn from the scratch there are a millions of sites available in the net to serve your purpose. you can find those easily just be doing some googling. visit this site as my recommendation :-
VBEXPLORER.Com
as the name suggests it is an virtual learning centre for vb6. great site...

this link leads you to a collection of some good vb6 sites :-
VB6 TOP SITES

this is another :-
VB FROM US

there is no limit in that. these are a quiet of them.

have a good learning experience.
good luck

regards
Shouvik

choudhuryshouvi 33 Posting Pro

try this out.

private sub combo1_change()
dim db as database
dim rs as recordset

set db=opendatabase(app.path & "\student.mdb")
set rs=db.openrecordset("select name from info where name like '%" & trim(combo1.text) & '", dbopendynaset)
combo1.clear
if rs.recordcount>0 then
     rs.movefirst
     while not rs.eof()
         combo1.additem rs!name
         rs.movenext 
     wend
else
     combo1.text="no record found."
endif
combo1.listindex=0  
combo1.selstart=0
combo1.sellength=len(combo1.text)
combo1.setfocus
end sub

here "student.mdb","info" and "name" are the access database,table & field names respectively. replace these with your own data.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

or u can use windows media player activex component also.
even u can play media file without using any controls. u can do this by implementing the mcisendstring api function

choudhuryshouvi 33 Posting Pro

why you are using 5 separate boxes? to solve this problem more efficiently try control arrays. this will be more easier for you. check out this sample code, it is implemented on control arrays. one advantage of this code is you do not need to encounter each & every textboxes to find out the maximum value among all values. you do not need to write those long if conditions also. this code is dynamic. it is capable to find out the max. value without bothering how many textboxes u used in your form. just put a single textbox and make no. of copies of it that you want. this will create the control arrays of the textbox. now put a label and fire this code. you will get your answer.

Dim ctlControl As Object
Dim x() As Integer, c As Integer, i As Integer, max As Integer

c = 0
On Error Resume Next

For Each ctlControl In Me.Controls
    If TypeOf ctlControl Is TextBox Then
        c = c + 1
        DoEvents
    End If
Next ctlControl

ReDim Preserve x(c)

max = Text1.Item(0)
For i = LBound(x) To UBound(x) - 1 Step 1
    If max < Val(Text1.Item(i)) Then
        max = Val(Text1.Item(i))
    Else
        max = max
    End If
Next i

Label1.Caption = max

ok by implementing this logic i've not meant that others methods are not workable. no i'm not saying that at all. but this logic is more practical.

try this and get me your feedback.

ok......
good …

choudhuryshouvi 33 Posting Pro

try this and send me your feedback.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

please i need a code that can help me search records from a table in vb.

check out this code. this code used the followings :-

DATABASE : student.mdb
TABLE : details
FIELDS : roll, name
DB LOCATION : same as the project folder
OUTPUT CONTROLS : txtrollno (for holding roll no) and txtname (for holding name)

replace those in the above with your own stuffs

Dim db As Database
Dim rs As Recordset
Dim str As String, confirm As Integer

Set db = OpenDatabase(App.Path & "\student.mdb")
Set rs = db.OpenRecordset("details", dbOpenTable)
If rs.RecordCount > 0 Then rs.MoveFirst

begin:
str = InputBox("Enter student roll no :", "Search Student")
If Trim(str) = "" Then
    confirm = MsgBox("No roll no. has been supplied." & vbCrLf & "Do you wish to abort searching?", _
    vbQuestion + vbYesNo, "Search")
    If confirm = vbNo Then
        GoTo begin
    Else
        Set rs = Nothing
        Exit Sub
    End If
Else
    Set rs = db.OpenRecordset("select * from details where roll='" & Trim(str) & "'", dbOpenDynaset)
    If rs.RecordCount > 0 Then
        txtrollno.Text = rs!roll
        txtname.Text = rs!Name
    Else
        confirm = MsgBox("No student with RollNo. " & str & " has been found." & vbCrLf & "Would you like to re-search?", _
            vbQuestion + vbYesNo, "Result")
        If confirm = vbNo Then
            Set rs = Nothing
            Exit Sub
        Else
            GoTo begin
        End If
    End If
End If

let me know if this helps you.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

you are welcome.
don't forget to tell me what have u got finally

i'll be waiting to hear from you.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

can you be more cleared on that?

choudhuryshouvi 33 Posting Pro

do not post same thread more than once
check your previous post for an answer.

choudhuryshouvi 33 Posting Pro

just clear this out first.

will the values from both textboxes update the same field or u need to update two separate fields with these two values simultaneously?

if i wrong judged this then plz make me correct

choudhuryshouvi 33 Posting Pro

when a month is starting store the starting date. u can store the date in a database or in windows registry. it is better that u store it into the registry.

then while performing a transaction compare current system date with the stored one and find total month difference. if its 1 then one month is covered up then reset the transaction no. to 1 and start counting from it. store current transaction number also so that you can track it while creating the next no. if the month diff. is not equal to 1 then retrieve last transaction no. and increament it by 1 to get the new no.

i hope this logic can be implementable.
try this out and tell me if u need any further assistance.

good luck

regards
Shouvik

choudhuryshouvi 33 Posting Pro

How to create a Installation fiel in Visual Basic 6.0?

Vasanth

follow the following steps to create the installer for ur project. but before trying this make sure that u have created the executable(.exe) for ur project. hope u know how to create that.

1.close ms vb6.0 ide
2.click start>-programs->microsoft visual studio 6.0->microsoft visual studio 6.0 tools->package and deployment wizard
3.click browse to locate ur project file(.vbp)
4.click package
5.click yes to start the recompilation process
6.in package type select standard setup package and click next
7.select the destination where u want to create the package folder for ur project.this folder will contain all the supported and main application files required to install ur apps in some other client machine.
8.click yes to create the folder if it doesn't exist and click next
9.the next list that will come will display all necessary files to build the setup.click add to insert some other files from ur project to the said list.if u any access database file,click this button,locate ur db file and click open to add the file to the list.this list will also help u to remove any unnecessary files that u donot wish to install in the target machine with apps.u can also add help files(if any) for project from this option.but do not ever try to remove the .dll,.ocx,.lib or .exe files.click next
10.if u want ur setup becomes a standalone package select single …

choudhuryshouvi 33 Posting Pro
form2.text1.text=text1.text

assuming that the command will be fired from the current form

choudhuryshouvi 33 Posting Pro

when will u try it completely depends upto you and it really doesn't any matter.

just give me your feedback
that's all what i need from you.

ok
bye

choudhuryshouvi 33 Posting Pro

you are welcome
try it and give me ur feedback

choudhuryshouvi 33 Posting Pro

Hi! I developed an application that shows pictures in vb6 program. A pice of cake. I don´t want to deal with zooming and scrolling so I would like to sent it to the windows fax and picture viewer but I can´t find it.

Any hint ...

QuijoteMx

fire this API from ur code :- (declare it in the general section of ur form)

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

use this approach to open the file content with the default application :-

ShellExecute Me.hwnd, "Open", "c:\windows\clouds.bmp", "", "", vbNormalFocus

replace the RED marked portion with path of the picture file you wish to open. the api will send it to the default application registered in windows registry. in most cases it opens the pic in paint but if it configured with windows picture & fax viewer then it will open the pic with it.

hope this will work

regards
Shouvik

choudhuryshouvi 33 Posting Pro

you can connect the crystal report to both of your access table or any query that you created for the purpose. but it is better that you use an query in your report. the steps are :-

1. first create the table and then create an query
2. in the crystal report ide select new->as a blank report(from the gallary wizard)
3. from the data explorer window expand the database files folder and double click find database file
4. then locate ur access db and open it
5. if the database is passwd protected then mention it
6. after this all of ur tables and all associated queries will be displayed
7. then the option will be on ur hand whether you need to use an table or query to build the report. just double click to add it to the field explorer.

now if you need to access the database from ur application by cracking the password u can try this code :-

dim db as database,rs as recordset

Set db = OpenDatabase("<your database file path>", False, False, ";pwd=<your database password>")
Set rs = db.OpenRecordset("<your table name", dbOpenTable)


hope this is enough for your purpose
let me know if this works out for you.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

check out this sample
don't forget to post your feedback

regards
Shouvik

choudhuryshouvi 33 Posting Pro

thanks for such an honorable comment.
thanks once again debasisdas

regards
shouvik

choudhuryshouvi 33 Posting Pro

you can use the odbc approach to connect with your server. for this you have to make a security login or user for your own sql server database. you can create the user using sql server enterprise manager. here are the steps :-

1. launch sql server enterprise manager
2. login to the server. this login does not require you to input any passwords just make sure that ur service manager is running.
3. then expand the security folder->right click logins->new login
4. give a name for the user, select sql server authentication option, mention a pwd, select ur database,confirm ur passwd and click ok to create the user
5. u can also set server roles and access to the default database from this section.

now its time to create the odbc string. here are the steps :-

1.goto control panel->select administrative tools and the data sources(odbc)
2. select add from user dsn tab
3. select sql server as ur source driver and click finish
4. mention a name for ur dsn, give a description(optional), mention server name(this should be "(local)" with brackets but without the quotes)
5. select 2nd option from the next page
6. give the login id and passwd exactly same as u mentioned while creating the user
7. change the default database to ur db name and select ur default language
8. click finish to build the DSN

now the configuration …

choudhuryshouvi 33 Posting Pro

u r welcome
if there is any more problem tell me

ok......

regards
Shouvik

choudhuryshouvi 33 Posting Pro

well i have only worked with vs 6.0
is there any package and deployment tool available with vb5.0?
if its then u can proceed with it. just follow my previous reply to this thread.
otherwise u can download and install any third party installer from the net. there is one that i can tell is Setup Factory. this installer package has inbuilt support for vb applications both for vb5 and 6. so make a search in google with "setup factory" and try it.

let me know if this helps

regards
Shouvik

choudhuryshouvi 33 Posting Pro

Hi,
Can anyone tell me how to make VB forms an application as an installable something like an application.
Thanks,
Priya

check out this thread :-
How to create setups

scroll down and goto reply #8

hope u'll get ur answer

regards
shouvik

choudhuryshouvi 33 Posting Pro

any pls help mo on How to load a filename on a LISTBOX.
also pls teach me that when i click on the filename loaded on the listbox
it will run,

i only need to load the names of my movieclips which is all (.avi)
then when click will play on a media player

pls help.... search and tried lot of ideas
none work :'(

though you can easily solve this prob using the standard file listbox intrinsic control , i'm attaching a sample code here that is capable in doing exactly what u want. it uses an ordinary listbox to collect the filenames and display them. also you can click an item into the listbox to play it in the media player.
in this sample i've used windows media player control (9 series) which in default not installed in every machine. the default one is windows media player 6.4 . so if u got any trouble on that plz forward ur problems. i'll solve them out.

see the screenshot also...

ok......

regards
Shouvik

hawisme000 commented: great help! +1
choudhuryshouvi 33 Posting Pro

wish you good luck
don't forget to know me the result you got

ok......

bye

choudhuryshouvi 33 Posting Pro

sorry, but could you be more clear on expressing your thoughts?

choudhuryshouvi 33 Posting Pro

use the isNull function to check whether any of the fields containing any valid data. if it returns false means the fld has some data. so go and display it.

choudhuryshouvi 33 Posting Pro

what exactly did u mean by it?
and what about "word"?
is it any string within your program or you want to select text from Microsoft Word?

plz clarify in more detail

choudhuryshouvi 33 Posting Pro

hi Jaasaria,
thanks for ur reply.
if u got ur answer then plz mark this thread as solved.

bye

regards
Shouvik

jaasaria commented: thxxxxx for helping me.. +1
choudhuryshouvi 33 Posting Pro

hey Jaasaria
Check out this

regards
Shouvik

choudhuryshouvi 33 Posting Pro

The library was selected but apparently the order of all the selected library was not good; moving it up in the list solved the problem.

you do not need to explicitly order the reference list. whenever u select some references and click ok, visual basic automatically moves up those selected references and ordered them one by one at top of the list which in result helps to identify the libraries used by the current project.

It's very good to hear a good news from you.
Thanks once again...

regards
Shouvik

choudhuryshouvi 33 Posting Pro

from within your vb6 ide, goto project and then click references. scroll down within the dialog box that appears and select "Microsoft DAO <version no.> Object Library". click ok to accept.

then save ur project and run it. it will execute properly.

let me know if this helps you.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

looks like you'd mistaken me.

my question is to invoke a file open dialog box by pressing a button from a web form not just displaying a confirm button.

i do know how to implement confirm button but my problem is not this now.

can anyone tell me how to accomplish this?
is it possible???

plz plz.............

regards
Shouvik

choudhuryshouvi 33 Posting Pro

what exactly your question is???

your code looks absolutely OK.

then what??