choudhuryshouvi 33 Posting Pro

let me give some time.
i'll attach the code till tomorrow

regards
Shouvik

bye

choudhuryshouvi 33 Posting Pro

I'm making a media player with visual basic 6 and im having trouble on adding the video feature(so that i can not only play the music but i can see the video with it) to the media player? could any1 help me?

have you copied exactly from that site or made some modifications?
i mean to say that site uses a picture box to display the video clips. but you can also use
the windows media control to play video files. i recommend you to go and use this control. this control has more powerful functions and methods than the mmc control and more easier to use.

check out the code to play both video and audio files :-
(if u use media player control)

[B]mediaplayer1.filename="c:\my video.dat"
mediaplayer1.play[/B]

if u use microsoft multimedia control then u can try this :-

mmc.FileName = "F:\Richik\GNR videos\Guns N' Roses - Civil War (Video).mpg"
mmc.Command = "open"
mmc.hWndDisplay = Picture1.hWnd
mmc.Command = "play"
End Sub

Private Sub mmc_Done(NotifyCode As Integer)
If NotifyCode = 1 Then mmc.Command = "close"
End Sub

see whether this helps you to get your problem solved or not.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

i dont want the user to type command manually in to register the control (regsvr32)

is there someway i can create a setup file only for this control so it will be automatically registered in his pc??

you can create a ms-dos batch file to accomplish this task.
just supply the comdlg32.ocx file with batch file to ur user's pc. now if the user double clicks the batch file the ocx will be automatically registered.

Mbt925 has already supplied the ocx file for you. now i'm giving you the batch file code. here it is :-

ECHO OFF
CLS
COPY COMDLG32.OCX %SYSTEMROOT%\SYSTEM32\COMDLG32.OCX
REGSVR32 COMDLG32.OCX
ECHO ON

open notepad and copy-paste this into editor. now save the file with .bat extension(select "All Files" from save as type combo inside the save as dialog)

now just double clicking the batch file will do the rest for you. but make sure that the .ocx file and the batch file exist in the same directory.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

where did u find "mouse press" event???

could u tell ur question more clearly???

choudhuryshouvi 33 Posting Pro
choudhuryshouvi 33 Posting Pro

thanks to all of you who made visit to this thread.
its pleasure to tell you guys that i've solved this problem. now i'm getting the table names from my sql database.

so, this thread is now closed.

thanks to all of you.....once again...
bye

choudhuryshouvi 33 Posting Pro

I've developed a software using VB6 and MSSQL 7.0. Now I need to create a backup-restore program on behalf of my software. For this I need to fetch down all the table names located inside the database used in the software.

My database name is -->BILLING_SYSTEM
and I've also created a Security LogIn -- BS(BS) for this.
All jobs have been done using Sql Server Enterprise Manager.
My software uses an USER-DSN connection to communicate with the sql server.

Now my question is how can I issue an sql command which can fetch down all the table names
from the BILLING_SYSTEM database. I mean what is the sql query for that like we issue this in case of Oracle :-

SELECT * FROM SYSDBA_USERS WHERE OWNER='<DATABASE NAME>'

Can anybody help me????

regards
Shouvik

choudhuryshouvi 33 Posting Pro

SELECT Name,Date,Action FROM Track WHERE SerialNumber = " & val(text1.text)

choudhuryshouvi 33 Posting Pro

i had a problem how can i download music to my project and what is that command and who can give me a sample of a project that is like a media player or mp3 player.
thnx to all

check out this sample application.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

I feel bad that i keep coming and saying it's not working, but it still isn't working. I got another error about the CommonDialog. I'll attach the screen shot for you.

that's a version confliction problem. not a problem generating from the program at all.
Ok i'm attaching the comdlg32.ocx used in this code. copy this file to your system directory and register it using the following command :-

regsvr32 %systemroot%\<name of your system directory>\comdlg32.ocx

if u r using win9x then ur system dir becomes "system" without quotes.
if u r using winxp or higher ur system dir becomes "system32" without quotes.

try this.
hope this time it will surely work for you.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

I have a simple web application which aims to take backup from an oracle9i database. Where i need to click on a button to invoke the openfile dialog box and select the location and input the dump filename. After this the application will start creating the backup and create the dump file in the selected location.

Now my question is how can i invoke a common dialog box using asp.net (my code-behind is in c#)

Is it possible?

Can anyone help me
This is very urgent

Looking for some good stuffs

Thanks in advance...

regards
Shouvik

choudhuryshouvi 33 Posting Pro

check out this code.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

here is a sample. check this out.

''declaring the array here
Dim a(1, 2) As Integer

''printing values
Private Sub Command1_Click()
Dim i As Integer, j As Integer

For i = 0 To 1 Step 1
For j = 0 To 2 Step 1
Print a(i, j)
Next j
Next i
End Sub

''initializing with default values to all possible subscripts
Private Sub Form_Load()
a(0, 0) = 9 & "," & 19
a(0, 1) = 10 & "," & 20
a(0, 2) = 11 & "," & 21
a(1, 0) = 12 & "," & 22
a(1, 1) = 13 & "," & 23
a(1, 2) = 14 & "," & 24
End Sub

hope this will help you.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

i think your question is not at all related with VB6 which is the core discussion topic of this forum.

post your thread in the vb.net forum to increase your answer receiving possibility.

(DON'T TAKE IT OTHERWISE)

choudhuryshouvi 33 Posting Pro

what did you mean by "tags"?
is it row in the table you are accessing???

you can use a timer object to accomplish this task.
call the procedure you've written to check the table for rows meeting a certain condition under the timer1_timer event and initialize the timer event from form_load.

hope this will do something good to you.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

call the procedure timer1_timer under form_load event.

choudhuryshouvi 33 Posting Pro

hope you've the file and thanks for your reply.

if you've benefited from what i sent to you or if you got your answer then plz mark this thread as SOLVED

have a nice day.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

ok man i've sent the exe to your e-mail id.
check that.
hope this time it will work for you.

regards
Shouvik

choudhuryshouvi 33 Posting Pro
choudhuryshouvi 33 Posting Pro

Visit this link and download the article and check whther it helps you.

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=10588&lngWId=1

choudhuryshouvi 33 Posting Pro
choudhuryshouvi 33 Posting Pro

Hello rockstar,

i've send the zip file to your e-mail id.
check that and send me your feedback.

for your consideration plz use a well-reputed compressing software(e.g, WINZIP) to extract files from the zip archive. Use the latest version of winzip. you can freely download it from :-
http://www.winzip.com/index.htm

good luck

with regards
Shouvik

choudhuryshouvi 33 Posting Pro

Hi all, I've been designing a program in VB6 to extract certain rows of data from a SQL Database and shoot them out over email. Problem is, the farthest I can get is to printing them on the VB form, and can't do much else. I get an error when I try to send the the data out over the Outlook script, claiming it doesn't support it. So I need someway to get this data into a more managable form before I email it. I'd also like to be able to display it in a text/label box rather than just the Print command.

I'm attaching an application that is capable in register users into a sql database and sending mails to them using each of the users email address. Check whether this application helps you to get your answer or not. I've used an USER-DSN connection to communicate with the back-end server and i've used Microsoft Sql Server 7.0 . I've assumed that you are already familier in how to create an user-dsn.

For your consideration i've also included the script file of the sql database that i'd used. But to proceed in working with the database you have to create a user login named "STUDENT" with password "STUDENT" using the sql server enterprise manager. I'm also assuming that you know how to create a security login in sql server. After extracting from the zip file, run the file "script.sql" using sql server query analyzer to create the table …

choudhuryshouvi 33 Posting Pro

I have made a program that you can add your contacts but i need to get a way to edit the persons details....
The details are kept in a txt file(because i don't know how to make this using a db)
I have a list box showing the name and surname of the contact and when you select anyone their details are shown in textboxes ready to be changed but I need the code for replacing or deleting a specific line from txt...

I have searched for this but not found any help... if another thread already exists for this topic sorry, and please post link... thank you...

Hi Dell XPS.
Check out this sample code. just take two textboxes(text1,text2), three buttons(command1-3) and a listbox(list1) for testing :-

Option Explicit

Dim i As Integer

Private Sub Command1_Click()        ''for adding new record into the textfile
If Text1.Text <> "" And Text2.Text <> "" Then
    List1.AddItem Text1.Text & " " & Text2.Text
    Call UpdateRecords
    Call LoadRecords
Else
    MsgBox "Input details."
    Text1.SetFocus
End If
End Sub

Public Sub LoadRecords()    ''reads the file and fetches all existing records
Dim str As String

If Dir(App.Path & "\info.txt") <> "" Then
    List1.Clear
    Open App.Path & "\info.txt" For Input As #1
        Do While Not EOF(1)
            Input #1, str
            List1.AddItem str
        Loop
    Close #1
Else
    MsgBox "Record file is missing."
End If
End Sub

Private Sub Command2_Click()        ''for editing the selected record's info
If Text1.Text <> "" And Text2.Text <> "" Then
    List1.RemoveItem i …
choudhuryshouvi 33 Posting Pro

well that's a problem of daniweb itself. the same problem had been faced by many other members also. but don't worry, if u didn't get the file properly just give me your e-mail id and i'll send the zipfile to you.

OK.......

regards
Shouvik

choudhuryshouvi 33 Posting Pro

Try the code in the attachment.
But I've used ListView instead of MS Hierarchical FlexGrid
It is more easier to use lv than mshfg.
If u wish you can change it by yourself.

Hope this will help you.
Plz know me your feedback.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

First off, I do have VB5. Second, my problem is that when i put your code in and changed it to agree with my program it said some variables were undefined. I could try to update, but variables being undefined was my only problem.

I'll try to attach it again. The files are separate this time

Ok i've checked your application. The errors you were getting was in your program. It was missing the object names like in my sample coding which i posted here have a textbox with object name "Text1". now what happened(if i was not wrong) you just copied the code within your form and forgot to change the name of textbox. In your form(frmtemplate.frm) there is no textbox control with name "Text1". Only you have is the "txtuserarea" located in your frmtemplate.frm . Now i've fixed this in your coding and you will be happy by hearing that everything is running smoothly without any single piece of error.

OK??

Try the attached one and plz don't forget to post your feedback.

Good Luck

regards
Shouvik

choudhuryshouvi 33 Posting Pro

thanks for your feedback.
now go through the code, check it and ofcourse if you get benefited from that code plz don't forget to post your feedback here.

good luck

regards
Shouvik

choudhuryshouvi 33 Posting Pro
choudhuryshouvi 33 Posting Pro

hi i've sent the file to ur gmail id.
plz check it out and know me ur feedback.

choudhuryshouvi 33 Posting Pro

Unless i didn't do it right, it didnt work for me. one thing i noticed in the code though was to pick something with version 6 at the end. I only have version 5. So i tried five instead and like I said it didn't work.

This code runs smoothly in VB6 without having a single piece of problem.
Looks like you are using VB5. Isn't it? Now could you plz tell what exactly was happened when you tried that code? Can u post the output here or your application(if possible)???

If you wish to continue in using the above code you have to upgrade your application to version 6.

Are you interested in upgrading to VB6? If yes, then you can download the service pack files from here: http://www.microsoft.com/downloads/details.aspx?familyid=7b9ba261-7a9c-43e7-9117-f673077ffb3c&displaylang=en

Let me know if this works for you.

choudhuryshouvi 33 Posting Pro

check your data before you try to save it. Length of your data should not exceed size of the field.

choudhuryshouvi 33 Posting Pro

hi Shouvik,
A personal thanx for ur patience with me.Tis is wat I wanted.I hav another doubt.I need to read data from an Xml file.Can I do tat using DAO??Or do I need to Use ADO only?Pl advise.I suppose u need to use some DOM
With regards,
Kartik

well that's a separate issue.
if u've benefited from the above code then mark this thread as SOLVED.

choudhuryshouvi 33 Posting Pro

how to generate alphanumeric autonumber in Aceess backend with VB6 coding

check this code in the attachment.

hope this will help you.
know me your feedback.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

I'm just going to attach the exe so you can see what I'm talking about.

try this code. for testing take a textbox(text1),three buttons(command1-3) where 1 is for "Open",2 is for "Save" and 3 is for "Save As". Add a control commondialog to ur project. To add this right click->toolbox and select components->scroll down and check on "Microsoft Common Dialog Control 6.0"->click ok. drag the control on ur form and change its object name to "cd1".

Option Explicit

Dim openfile As String

Private Sub Command1_Click()   ''For Open
Dim fnum As Integer
Dim str As String

On Error GoTo err1

cd1.CancelError = False
cd1.Filter = "Text Files{*.txt}|*.txt"
cd1.Flags = cdlOFNFileMustExist + cdlOFNPathMustExist
cd1.InitDir = "C:\"
cd1.DialogTitle = "Select file to open..."
cd1.ShowOpen

If cd1.filename <> "" Then
    fnum = FreeFile
    Open cd1.filename For Input As #1
        str = Input(LOF(fnum), #fnum)
    Close #fnum
    Text1.Text = str
    Close #1
    openfile = cd1.filename
    Me.Caption = "File Opened - " & cd1.filename
End If

Exit Sub

err1:
    Err.Clear
    MsgBox "Unable to open the requested file...!", vbCritical, "Error opening file"
    Me.Caption = "File not opened...!"
    Exit Sub
End Sub

Private Sub Command2_Click()  ''For Save
On Error GoTo err1

If Trim(openfile) = "" Then
    cd1.CancelError = False
    cd1.Filter = "Text Files{*.txt}|*.txt"
    cd1.Flags = cdlOFNOverwritePrompt + cdlOFNPathMustExist
    cd1.InitDir = "C:\"
    cd1.DialogTitle = "Save as"
    cd1.ShowSave
    
    If cd1.filename <> "" Then
        Open cd1.filename For Output As #1
            Print #1, Trim(Text1.Text)
        Close #1
    End If
    
    Me.Caption = "File Saved - " & cd1.filename
Else
    Open openfile For Output As …
choudhuryshouvi 33 Posting Pro

not understood actually. plz clarify in detail

choudhuryshouvi 33 Posting Pro

Hi Shouvik,
ur pgm is great.Tis is wat i wanted.Thanx a lot.
but pl clarify few things.


could u pl explain the syntax:

Set rsd = db.OpenRecordset("select cnt_name from
names where cnt_name='" & Trim(Text1.Text) & "'", dbOpenDynaset)

Here just tel me where are the places where we need to use & " '.
Sorry,i am not familar with DB syntax.

here rsd is just a recordset object. i've assumed that u r using DAO technique to make connection with the database. in case of DAO it is 'Recordset' but in case of ADO it is 'New Adodb.Recordset'.

recordset object is actually used to indicate a table or in other words it works as an pointer of the table. when we point a recordset to a table it adjusts itself with the table so that it can identify the BOF and EOF of the table to which it is pointed. in case of DAO we also require a database object in order to open the database before proceeding with any other task in relation with any tables presented in the database. you can also use a connection string to make connection in DAO but it is more easier to use a db object to create the connection.

this line dim db as database declares 'db' as a database object which can only recognize a DAO recordset.

this line set db=opendatabase(app.path & "\mydb.mdb") tells your program to create an active connection to the …

choudhuryshouvi 33 Posting Pro

check out this application logic. assuming that the database used by you is an access database. the db here used is "employee", table "details" with one field "empname". (the Green Lines are comments)

Option Explicit

Dim db As Database
Dim rs As Recordset

''performing the addition operation with the validation
Private Sub Command1_Click()
If Trim(txtempname.Text) <> "" Then
    If IsEmpExists(Trim(txtempname.Text)) Then
        MsgBox "The employee " & Chr(34) & Trim(txtempname.Text) & Chr(34) & " already exists in the database." & vbCrLf & _
            "Please use a different name rather than this one.", vbInformation, "Duplicate Employee"
        txtempname.SelStart = 0
        txtempname.SelLength = Len(Trim(txtempname.Text))
        txtempname.SetFocus
    Else
        rs.AddNew
        If rs.EditMode = dbEditAdd Then
            rs!empname = Trim(txtempname.Text)
            rs.Update
            Call LoadEmployees
            MsgBox "New employee created.", vbInformation, "Done"
            txtempname.Text = ""
            txtempname.SetFocus
        End If
    End If
Else
    MsgBox "The employee name should not be null.", vbCritical
    txtempname.SetFocus
End If
End Sub

Private Sub Form_Load()
''making connection to the database and opening the employee table to retrieve existing records
Set db = OpenDatabase(App.Path & "\employee.mdb")
Set rs = db.OpenRecordset("details", dbOpenTable)

If rs.RecordCount > 0 Then
    rs.MoveFirst
Else
    MsgBox "No employee details found." & vbCrLf & _
        "Please add some records.", vbInformation
End If
''creating the list of existing employees
Call LoadEmployees
End Sub

''this is the core function which is responsible for the entire validation process to be executed. this function takes
''the employee name as an arguement that you wish to check whether already exists in the database or not. the function
''checks for its first occurance. …
choudhuryshouvi 33 Posting Pro

ya.u got it rite.user enters data thru form1 and combobox in form2 reflects that data.
My logic mite be a little bad as I am not familiar with DB syntax.

What about the code which I provided to you?
Have you seen it yet?
Make a visit to the code and you'll surely get your answer.

choudhuryshouvi 33 Posting Pro

Hi,
I have completed my project in all respect but I would like to include all
table and report of Access and Crystal Report respectively in my VB 6 project SETUP FILE.
So. pl help me to include such file while creating SETUP file. If there is no way than I have to make extra exercise of copy paste wherever I install my SETUP file

Keharsingh

Visit this link :-
http://www.daniweb.com/forums/thread95540.html

scroll down and goto Reply #8

hope u will get ur answer

choudhuryshouvi 33 Posting Pro

Hey,thanx Ur Code Was Great,but I Need To Enter Data Like country Name like india,america,australia etc Thru form1.the Next Time I Enter form2,i Should Get List Of Al The Countries.
& If I Delete Any Country Thru form1,it Should Reflect In Listbox Of form2.
I Need The Code Little Urently!!

Thanks for the feedback.
Check this one too. I think you'll surely get from it what you want.

Best regards
Shouvik

choudhuryshouvi 33 Posting Pro

first of all clear one thing :-

are u trying to recover password of your access database or your vb source files?

choudhuryshouvi 33 Posting Pro

Check whether the attached code helps you to get your answer or not.

Don't forget to post your feedback here.

Regards
Shouvik

choudhuryshouvi 33 Posting Pro

Sounds well but not really helpful to me in case of solving my problem as it couldn't in my machine.

So what would be the summery?
What are you suggesting me to do? is there any way or i've to do the dirty work???

One more thing, is only uninstalling IIS can fix this problem? i'm not sure. asking for your suggestion.

choudhuryshouvi 33 Posting Pro

yes, i've already been advised that. though i know that this is the only option i've left but i was wondering whether there is any other way to solve this problem?

one thing i should tell you. before installing vs2005 i'd installed iis5.1. is that affecting? i mean to say is there any kind of version confliction problem occuring between IIS5.1 and VS2005's webdev.webserver.exe. i'm asking you because one of my office colleague has told me about that and also told me that i shouldn't install IIS on my local machine.

Could u plz tell me is that correct or not? because i've already searched microsoft knowledge base where microsoft said that both the IIS and VS2005's webserver can run in the same local machine.

choudhuryshouvi 33 Posting Pro

@choudhuryshouvi: since this happens for web apps and winforms apps, it almost sounds like your .NET runtime is messing up. Is it possible for you to post your web app, and I can try running it on my machine?

its a simple application which only has a textbox,a label and a button. the program is i'll write some text into the textbox and clicking the button will display the same as the label's text. for this i've written the following code:-(using my code behind page in vb.net)

on button_click()
if trim(textbox1.text)<>"" then
   label1.text=textbox1.text
   textbox1.text=""
   textbox1.focus
else
   msgbox("plz input some text.")
   textbox1.focus
endif

that's all. i was just testing my local web server whether its working or not but i couldn't.

i don't how will it help you in solving my prob. let's see what happens???

choudhuryshouvi 33 Posting Pro

I've installed VS2005 in WinXp SP2.

When i'm trying to run asp.net web application in my local machine i'm getting the following error:-

"Unable to connect to visual studio's localhost web server."

same type of thing is happening when i'm trying to open a windows form application. this time the error is :-

"The application is failed to initialize properly. Click on OK to terminate the application."

What is the cause and remedies for the above error?

choudhuryshouvi 33 Posting Pro

list box which diplays its item as a check box. make a lisbox and set its style to Checkbox from the property window and add the elements. You will get the idea. By the way how can i use listview to change the color of first 5 rows to and last 5 rows to red.
any code snippet??

see the following code. it adds all monthname in a listview and colors first 5 row to blue and the rest to red. for better viewing set its view to lvwreport(right click lv->properties)

Dim i As Integer
Dim li As ListItem

For i = 1 To 12 Step 1
    With ListView1
        Set li = .ListItems.Add(, , MonthName(i))
    End With
Next i

For i = 1 To ListView1.ListItems.Count Step 1
    If i <= 6 Then
        ListView1.ListItems(i).ForeColor = vbBlue
    Else
        ListView1.ListItems(i).ForeColor = vbRed
    End If
Next i

hope u will grab some

regards
Shouvik

choudhuryshouvi 33 Posting Pro

to accomplish this in an easiest way you can use the listview control.

but first clear me one thing. what did u mean by this :-

I need to color few items in a list box having style as checkbox

after this i can give u some code snippets(if u wish to do so)

regards

Shouvik

choudhuryshouvi 33 Posting Pro

use the following code. before use it take three textboxes(text1,trxt2,text3); one listbox(list1) ; one label(label1); and a commandbutton(command1)

Option Explicit

Private Sub Command1_Click()
Dim num As Integer

num = 0
begin:
num = InputBox("Enter exam marks. -1 to end", "Marks")
If num > -1 Then
    List1.AddItem num
    GoTo begin
End If

Text1.Text = "Max :" & GetMaxMark
Text2.Text = "Min :" & GetMinMark
Text3.Text = "Avg :" & GetAvg
Call Result
End Sub

Public Function GetMaxMark() As Integer        'to find out the maximum mark
Dim i As Integer, max As Integer

max = 0
For i = 0 To List1.ListCount - 1 Step 1
    If Val(List1.List(i)) > max Then
        max = Val(List1.List(i))
    End If
Next i

GetMaxMark = max
End Function

Public Function GetMinMark() As Integer               'to find out the minimum mark
Dim i As Integer, min As Integer

min = List1.List(0)
For i = 0 To List1.ListCount - 1 Step 1
    If Val(List1.List(i)) < min Then
        min = Val(List1.List(i))
    End If
Next i

GetMinMark = min
End Function

Public Function GetAvg() As Double            'to find out the average
Dim i As Integer, sum As Integer

sum = 0
For i = 0 To List1.ListCount - 1 Step 1
    sum = sum + Val(List1.List(i))
Next i

GetAvg = sum / List1.ListCount
GetAvg = Format(GetAvg, "0.00")
End Function

Public Sub Result()            'to print the overall result status
Dim i As Integer, above40 As Integer, per As Double

above40 = 0
For i = 0 To List1.ListCount - 1 Step 1 …