choudhuryshouvi 33 Posting Pro

Thanks for reminding me about this after 4 years...
The solution was simple but I had spent many sleepfull nights in finding that.. :)
Here is what I had done in solving this issue :-

The problem was, NODE5 was not recognized as a web-server in our intranet network. So what I did, just set my localhost as a webserver from LAN settings. Below are the steps :-

  1. Open Control Panel
  2. Goto Network Connections
  3. Here you will find your LAN connection name under "LAN or High-Speed Internet" section. In my pc, it was "Local Area Connection 4".
  4. Right click on it and goto Properties.
  5. Click on Advance Tab and then click Settings. The Windows Firewall dialog will popup. Though you can directly open it from control panel but still I am writing the exact steps I performed 4 years ago.
  6. In firewall dialog, goto Advanced tab.
  7. In the list of connections, under Network Connection Settings, select your LAN connection name (in my case, "Local Area Connection 4") and click Settings.
  8. The Advanced Settings dialog will open. Goto Services tab.
  9. In the list of services, you will find "Web Server (HTTP)". Also make sure that Port No. 80 is open and granted access in windows firewall (if its enabled).
  10. Check it and when the service settings dialog will open, mention the name of virtual web-server in your intranet network. It will take your machine name in default. You can keep it or you can also change name.
  11. Continue hitting …
pritaeas commented: Shared after four years, wow! +14
choudhuryshouvi 33 Posting Pro

did you register the activex components as I said...

if yes then goto project->components and check on "Microsoft Windows Common Control 6.0" and click ok....

nagatron commented: thank you so much friend for helping me =) +1
choudhuryshouvi 33 Posting Pro

why you are using calender or month view.....???
its just a matter of selecting a date only...you can easily use the date picker control in vb....there is already a one in there for your use....just add the Microsoft Windows Common Control 2 6.0 from components list and use the datepicker control....

well now for the coding part....
you can easily use datepicker to query your database to get data filtered by a selected date...but the coding differs on the nature of the database...

if you use any local database like "msaccess", the sql should be-->

"select * from <table name> where doj=#" & format(dtpicker1.value,"MM-dd-yyyy") & "#"

where "dtpicker1" is the name of your datepicker control...

if you use any server side rdbms like sql server or oracle, the sql should be :-

"select * from <table name> where doj='" & format(dtpicker1.value,"dd-MMM-yyyy") & "'"

now the choice is yours....try any one of these and get me a feedback if this works out...

regards
Shouvik

choudhuryshouvi 33 Posting Pro

it can have possible three reasons :-

1. the msdxm.ocx module is not present in ur OS system directory.

2. your vs2005 software is opened and u hv a form where u have inserted an instance of the msdxm.ocx component.

3. if u r using windows vista then the above command regsvr32 won't work. it will only work less than vista versions.


check whether either of these is happening.

regards
shouvik

choudhuryshouvi 33 Posting Pro

i wanna to get size of file.
help me how to get this. anyone know how to do this.
any help will be appreciated :)

this is a simple but efficient code..

Dim fln,result
Dim fname as String

fname="c:\windows\regedit.exe"

fln = FileLen(trim(fname))
result = CInt((fln / 1024) / 1024) & " MB" & "(" & fln & " BYTES)"

Msgbox "FileSize is -->" & result

you will display a message box containing this text :-

FileSize is --> 9 MB(9016447 BYTES)

hope this helps you.

regards
Shouvik

dnk commented: much efficient :) +1
choudhuryshouvi 33 Posting Pro

Hi...
i want to make flash window...
after program completed something task then that window will flash.
i ask my friend and he said to use api function. but i don't have an idea to do this.
please help me masters...

any help will be appreciated.

best regard
Jade

here is a sample snippet for you. try it. just place a command button and a timer on your form for testing. set an interval for the timer. for ideal experience set it to 1000.

give me a feedback after you try this code.

Option Explicit

Private Declare Function FlashWindow Lib "user32" (ByVal hWnd As Long, _
ByVal bInvert As Long) As Long

Private Sub Command1_Click()
Timer1.Enabled = True
End Sub

Private Sub Form_Load()
Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
FlashWindow Me.hWnd, True
End Sub

hope this will help you.

regards
Shouvik

Jade_me commented: Great Code :) +1
choudhuryshouvi 33 Posting Pro

what have you meant by printer properties?

plz explain in detail.

or you can try this :-

add the component Microsoft Common Dialog Control 6.0 from Project->Components.
make an instance of it on your form.
now take a comman button and place this code,

Private Sub Command1_Click()
[B]CommonDialog1.ShowPrinter[/B]
End Sub

It will show you the windows Print dialog box (the same one which you might be seen when trying to print documents from external windows applications like Notepad,wordpad,etc.

using API becomes more advance technique. you can API to access printer properties and configure it right through your code like finding its driver, setting up proper port, sending print commands,etc.,etc. For API reference Visit This Link.

regards
Shouvik

Sawamura commented: great help :) +1
Naruse commented: simple and nice +1
choudhuryshouvi 33 Posting Pro

Its been a pleasure to share my code here.
This is the code which I used in my application. Hope others will be benefited from this having same problem like me.

[B]''this is for creating the user "BS" and associate it with the "BILLING_SYSTEM database[/B]
EXEC SP_ADDLOGIN 'BS','BS','BILLING_SYSTEM'
USE BILLING_SYSTEM
[B]''these are for granting server roles[/B]
EXEC SP_ADDSRVROLEMEMBER 'BS', 'sysadmin'
EXEC SP_ADDSRVROLEMEMBER 'BS', 'securityadmin'
EXEC SP_ADDSRVROLEMEMBER 'BS', 'serveradmin'
EXEC SP_ADDSRVROLEMEMBER 'BS', 'setupadmin'
EXEC SP_ADDSRVROLEMEMBER 'BS', 'processadmin'
EXEC SP_ADDSRVROLEMEMBER 'BS', 'diskadmin'
EXEC SP_ADDSRVROLEMEMBER 'BS', 'dbcreator'
[B]''these are for granting various database manipulation permissions[/B]
EXEC SP_ADDUSER 'BS','BS','public'
EXEC SP_ADDROLEMEMBER 'db_owner','BS'
EXEC SP_ADDROLEMEMBER 'db_accessadmin','BS'
EXEC SP_ADDROLEMEMBER 'db_securityadmin','BS'
EXEC SP_ADDROLEMEMBER 'db_ddladmin','BS'
EXEC SP_ADDROLEMEMBER 'db_backupoperator','BS'
EXEC SP_ADDROLEMEMBER 'db_datareader','BS'
EXEC SP_ADDROLEMEMBER 'db_datawriter','BS'
EXEC SP_ADDROLEMEMBER 'db_denydatareader','BS'
EXEC SP_ADDROLEMEMBER 'db_denydatawriter','BS'

Hope the above syntax will be acceptable and one more thing i must say this code is working like snapping knife in butter.

regards
Shouvik

peter_budo commented: Nice job, keep up good work +7
choudhuryshouvi 33 Posting Pro

Dim TaskID As Long
TaskID = Shell(App.Path \ CAIsetup.exe, vbNormalFocus)

=====================

what extension shall i used???

there is no problem with the extension. your setup package is of course an self-executable file and like other exes' it also has an extension .exe . there is a mistake in your syntax.
try this out.

Shell(App.Path & "\CAIsetup.exe", vbNormalFocus)

else you can use an windows api function to execute this.

API Implementation :-
declare this api function at general section into your 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

and this is your code :-
ShellExecute Me.hwnd, "Open",App.Path & "\CAIsetup.exe" , vbnullstring, vbnullstring, vbNormalFocus


think this helps.

regards
Shouvik

hawisme000 commented: thx again n again!! +1
choudhuryshouvi 33 Posting Pro

check out this sample, try it and give your feedback.

Dim str As String
Dim rs As New ADODB.Recordset
Dim li As ListItem

str = "select * from org_master order by org_id"
rs.open str, ADODB.adOpenDynamic, ADODB.adUseClient, ADODB.adLockOptimistic

lvoffice.ListItems.Clear

If rs.RecordCount > 0 Then
    rs.MoveFirst
    While Not rs.EOF()
        With lvoffice
            Set li = .ListItems.Add(, , (rs!org_id))
            li.SubItems(1) = Replace(rs!org_name, Chr(5), ", ")
            li.SubItems(2) = IIf(IsNull(rs!Description), "", Replace(rs!Description, Chr(5), ", "))
        End With
        rs.MoveNext
    Wend
End If

If rs.state = adStateOpen Then rs.Close
Set rs = Nothing

regards
Shouvik

jaasaria commented: thx 4 the help in making listview +1
choudhuryshouvi 33 Posting Pro

check this sample and give your feedback

regards
Shouvik

Sawamura commented: Great :) +1
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

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

if u r using windows media player :-

the syntax is:-

mediaplayer1.filename=commondialog1.filename
mediaplayer1.play

if u r using microsoft multimedia control :-

the syntax is :-

multimedia1.filename=commondialog1.filename
multimedia1.command="open"
multimedia1.command="play"

hope this will help you.

regards
Shouvik

hawisme000 commented: helpfull +1
choudhuryshouvi 33 Posting Pro

Can someone out there provide me with notes or information on using data reports in Visual Basic 6.0

Hi, i've attached a sample project. download it. it will help you in creating and understanding data reports in vb6.

rajeshkhanna_in commented: Nice Work!! Keep it up. It was really Helpful and educative +1