choudhuryshouvi 33 Posting Pro

try this code. hope this will help you.........

Dim db As Database
Dim rs As Recordset
Dim tot As Double

Set db = OpenDatabase(App.Path & "\rate.mdb")
Set rs = db.OpenRecordset("report", dbOpenTable)

tot = 0

If rs.RecordCount > 0 Then
    rs.MoveFirst
    While Not rs.EOF()
        tot = tot + rs!basic_pay
        rs.MoveNext
    Wend
End If

Text1.Text = tot
choudhuryshouvi 33 Posting Pro

thanks for all replies.
if you really got ur answer then mark this thread solved.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

use order by clause in your sql.

like ,
select * from <table name> order by <field name>

choudhuryshouvi 33 Posting Pro

ok i took the customer table and this is the code for it.
focus on the bolded part.

Dim db As Database
Dim rs As Recordset
Dim li As ListItem

Set db = OpenDatabase(App.Path & "\asa.mdb")
Set rs = db.OpenRecordset("customer", dbOpenTable)

[B]If rs.RecordCount > 0 Then
    rs.MoveFirst
    While Not rs.EOF()
        With lvcustomers
            Set li = .ListItems.Add(, , (rs!cus_num))
            li.SubItems(1) = IIf(IsNull(rs!cus_name), "", rs!cus_name)
            li.SubItems(2) = IIf(IsNull(rs!cus_tel), "", rs!cus_tel)
            li.SubItems(3) = IIf(IsNull(rs!cus_add), "", rs!cus_add)
        End With
        rs.MoveNext
    Wend
End If[/B]

also see the snapshot.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

there is no relation of chr(5) with the error "invalid property value".

this "chr(5)"was used by me in one of my application to retrieve value from one of the tables after just replacing the ascii code of vbnewline to ",".you can skip this character. there is no need of it in your code.

do you know what is the meaning of this error msg?
if don't then listen,
vb6 compiler returns this error if any column to which you are adding data doesn't exist in the listview at all.

you must have similar number of columns in the listview the no. of times you fire this li.subitems statement before adding data.
in this command li.subitems(1), the numeral within the paranthesis refers to the column to which you are adding data. you can consider it like an array. but in this case the lbound starts from 1. if the compiler doesn't find the column at the specified index position in the listview it fetches you "invalid property value" error.
to add data into the first col of the lv you use
set li=.listitems.add(,,(<your data to be added>))
then from second to n-th no. of columns you use li.subitems(<col. index no.>)=<your data to be added>

so as much as i told u the error was in your target lv not in the code and it would never be because it was used in several forms of my application and tested many times.

so …

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

its better to use an update query instead of using the update method.

choudhuryshouvi 33 Posting Pro

thank you very much too for such an honorable reply. i am feeling very proud at this time. this is all for you. i'm feeling like a charm who have been useful in helping people. thank you very much for keeping in touch.

remember one thing i am always been here for helping you people. so whenever you got any problem just remember me. this is my email id :
choudhuryshouvik@gmail.com
you can send your queries to my inbox also. i will try my level best to serve you efficient solution.

now when you got all the stuffs start learning now. when you got some knowledge then come back and we will discuss more things on this.

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

and one more thing i you think that your question has been solved then please don't forget to mark this thread solved.

regards
Shouvik

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

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

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

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

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

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

u r welcome
if there is any more problem tell me

ok......

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

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

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

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

could u tell ur question more clearly???

choudhuryshouvi 33 Posting Pro

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

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

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

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

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

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

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

try this one

under form_load() :-

Timer1.Enabled=False

under cmdswing_click() :-

Timer1.Enabled=True

choudhuryshouvi 33 Posting Pro

if u wish to call the cmdswing_click event from another event just call it under it. like if u want to call it in form_load event the syntax will be :-

private sub form_load()
call cmdswing_click
end sub

or if u wish to call the same event from an outside procedure declare the cmdswing_click event as public like this :-

public cmdswing_click()
<your code goes here>
end sub

now u can call the event from another form just like this :-
private sub form_load() 'this is form2
call form1.cmdswing_click
end sub

hope this will help
regards
Shouvik

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

hello Butt Gee,
if you cannot be able to find the shortcuts there, that means your os or might be you accidentally deleted it. but don't worry there is an alternate way. try this...

1. within vb6 ide, click Add-Ins->Add-In Manager
2. there you will find package and deployment wizard in the available add-ins list. select that and check on the two options below under Load Behaviour which are "Loaded/Unloaded" and "Load on startup". click ok to save and exit this screen.
3. then click the add-in menu again
4. now you can see the option appeared under this menu.
5. after clicking this option if you fetch any error then consider that you need to re-install visual studio in your computer.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

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 cab otherwise if u want part installer then select multiple

choudhuryshouvi 33 Posting Pro

the answer in the post #2 is correct. but there is another way. if u do not need a huge installing process then just install the vb6 runtime files on the target compuer along with ur apps. u can get the vb6.0 sp4 runtime files from http://www.microsoft.com

choudhuryshouvi 33 Posting Pro

we all know that's the result of ur hard work.but if u do not clearly state the problem how can somebody be able to figure this out?either u post the specific part where r u getting the error or completely describe the problem.

the other thing is, the version of the windows media player activex control is very much depended on the windows media player that u install in ur machine. by default when u install vs6.0 it installs the version 6.4 but if u install the microsoft windows media player externally(from any source)the version will be upgraded.if it happens u cannot be able to use the older version anymore.even if u used the old control in ur program, after the upgradation the existing control in ur program will not be recognized by the vb itself. then u can be able to run the executable only(if created). let's for example, u used wmp 6.4 ocx. now u installed wmp 10 in the same os. now if u try to run ur existing code u will fetch erros associated with the wmp control. these errors actually occur due to change in the methods and properties of the control in diff. versions. like if u wanna play a file using wmp 6.4 u code mediaplayer1.play, but if u use wmp 10 or some other higher version the equivalent syntax will be mediaplayer1.controls.play, so in this case after upgradation of the control the previous syntax will not be recognized by …

choudhuryshouvi 33 Posting Pro

post the code segment where u r getting the error. may be this error is occurring due to version confliction for the controls.r u using windows media player control 6.4(in xp) or installed the new version externally?

choudhuryshouvi 33 Posting Pro

no question of pain. i feel always happy when i do reply to someone. ok, lets begin.

to connect the database without using the VDM you need to create an ODBC DSN for the type of database you wish to connected to.

to create the DSN follow the step:-

1.goto control panel
2.select administrative tools
3.select datasources(odbc)
4.in the user dsn tab click on add
5.select the appropriate database driver.
for access it is "Microsoft Access Driver(.mdb)"
for sql server it is "Sql Server"
for oracle it is "Oracle in orahome<version no>"
where version no. is the version of oracle u have installed in ur server machine.lets say if u have oracle9i installed then the driver becomes "oracle in orahome9i",etc.

6.after selecting the driver click finish.
7.then in the dsn dialog box enter the dsn name in the provided textbox.this name can be anything.but make sure that it doesn't conflict with other dsn names.
8.you can also specify a description fror ur dsn there.this is an optional field.
9.then click the select button and locate the database file you wish to connect through the new dsn being created.click ok to save all settings and create the dsn.


in case of operation with vb6 do the following steps:-

1.open a new project
2.goto project->reference
3.check on microsoft activex dataobjects <version no> library.again this version no. depends on the version of …

choudhuryshouvi 33 Posting Pro

debasisdas,
i tried but it keeps giving me a syntax error.could something be missing?do u mean to write :
fac_type as

' " & fac_type & " '

and
booking_date as

' " & booking_date & " '

?

delete the trailing spaces from both side of the sql string. the correct syntax is:-

************for fac_type************
'" & fac_type & "'

************for booking_date************
'" & booking_date & "'

choudhuryshouvi 33 Posting Pro

see the sample project.
hope u will grab some idea from it.

before running the code add some records to the database.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

hi all, i have problem creating queries in access.this is because i do not know how to call the value from a variable in vb into the query in access.
let say in vb i've created :

Public booking_date As Date
Public fac_type As Integer
.
.
.
.
booking_date = MonthView1.value
fac_type = Combo1.ItemData

i suppose to have a query done in access which i will call in vb

SELECT TF.time_id
FROM TF
WHERE (((TF.fac_id)="fac_type") AND ((TF.reserv_date)="booking_date"));

how do i accomplish this?please help!
thanx in advnce!

Hi, i've attached a sample program. download it. hope it will give you some idea.
regards
Shouvik

choudhuryshouvi 33 Posting Pro

you can compare by taking the profile id of the harddisk being installed on a specific computer. u have to write the program in such a way that it should look for the harddisk profile id. if u want samples on how to get such element visit http://www.planet-source-code.com and search for "Disk Serial Number" under visualbasic

choudhuryshouvi 33 Posting Pro

use the code in the attachment.
hope it will help you.