aktharshaik 16 Posting Whiz

Any problems get back. If solved mark the thread as solved

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Make changes to ur database. make it more easier to query. set the id fields to numeric.

Keep looking. I'll post the modified version of ur project along with the modified database later.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

I have attached the modified version of ur project. Have a look at it.
Dereference the DAO Library in references. It is not required. ADO is very flexible to use.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Plz can u tell if U R writing the code in VBA Code window of Excel or Visual Basic.

Also it will be helpful if you give the code u have created to make the changes to those csv spreadsheets. If it is confidential then just specify some outline model of how the code looks.

Will help us to give u a precise solution


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Use the Package and Deployment wizard to create the Setup Package from the source system where u have developed this project.
This addin is a part of Microsoft Visual Basic.

1. Open ur project
2. Select Add-Ins -> Add-In Manager... option
3. Select the Package & Deployment Wizard
4. Put a check for Loaded/Unloaded and Load on Startup check boxes.
5. Click Ok.

Now u can find the Package & Deployment Wizard menu option in the Add-Ins menu. Click it and follow the instructions. This wizard will automatically identify all the required object, components and dlls for the project. except for user created files like ur database files, icon files etc. which if u want can manually add them in, i beleive 4/5 step of the wizard

Once the setup package folder is created, copy it to CD or pendrive and perform the setup process in the target computer.


Hope this helps u. Try it and if any problems get back to us.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Plz if u can post the little code u have tried and failed, what database u r using, tables and their field names involved in this, then it will b easy and quick for us to help u with the problem.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

As suggested by wrappingduke the DTPicker and the MonthView controls are comfortable to use.

Another suggestion is that if u r using VB6.0 and have not applied the Service Pack 6, do it now because some functionalities related to these controls have been rectified and patched.

The Component Reference Name is
Micorosoft Windows Common Controls-2 6.0 (SP6)

and the file is

MSCOMCT2.OCX

If the entry cannot be found in the Components Tab, u can browse for the above file from the components tab. The file MSCOMCT2.OCX resides in your "\WINDOWS\System" folder in Windows installed DRIVE for Windows 95,98 or Millenium editions
and "\WINDOWS\System32" folder IN Windows installed DRIVE for XP.
or sometimes
"\WINNT\SYSTEM32" if Windows NT, 2003 etc.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Dear,

As far as the connection to the db is concerned, u need to change the code at all places wherever u r connecting to the Access DB.
if u r using Jet Database Driver for Access, u need to change it to the Microsoft Foxpro Driver.

Coming to the SQL Queries most of the queries used in MS-Access work in FoxPro 2.6 for DOS.
Open your Foxpro IDE and try all the Possible Types of Queries u r using for MS-Access in the FoxPro command window once. Check out what type of queries r not working and just replace those.

Another Suggestion is that if u should and must have the flexibility of changing the Databases now & then, I suggest u that now is the time to work out on that in a more innovative method.

Create a database which stores the Types of Databases, Their Connection Strings, Current DB Type in use, SQL Queries, every possible variable content that ur project may be using. So that u can switch to the required one at any instance. Even this will pave the way for even if u r trying to go to some other database in future, like oracle, sql server etc. At that instance u will have very less work to do.

Of course all this requires a sufficient amount of time and man-power proportional ti the concern of the duration u have got to complete this.

Will try …

aktharshaik 16 Posting Whiz

Dear,
I think the problem is with the field name.
Rename ur field name from s.no to sno

the period might be being treated as an operator. it may be implying that 's' is the table name and 'no' is the field name.
usually field names are referred with respect to their table name using the dot operator like

tablename.fieldname

Employee.Name
Employee.Age
Student.No
etc...

Hope this may solve ur problem


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

It may be something like this.

Do While (Not Founder) And (Not Adodc1.Recordset.EOF)
 If Adodc1.Recordset.Fields("item_code").Value = Searchit Then
  Founder = True
  'do something here because your query has matched. The loop is running aimless. do like this
  MsgBox "You have queried for item code " & Searchit & " which belongs to " & Adodc1.Recordset.Fields(1)
  'and exit procedure
  Exit Sub
 End If
 [B]Adodc1.Recordset.MoveNext[/B]
Loop

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

USE

Adodc1.Recordset.MoveNext

BEFORE

Loop

STATEMENT

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

U want to resize controls automatically when form resizes.

Have a look at this sample project i have attached here. Observe the tag Property of each control.

Changing the tag property helps in resizing/positioning as per ur requirement.

u can use varWidth, varVertical, fixBottom, fixRight etc.

this code can be found at the following url with some additional information

http://www.codeguru.com/vb/gen/vb_forms/resizing/article.php/c5949/

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

u tried to download & execute my sample project?

aktharshaik 16 Posting Whiz

The Word Wrap property works. but the problem is with the height of the row in which the text is displayed. It does not grow automatically. Increase the height of the row in which there is lengthy text and u can find the text wrapped.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Call keyword is used to call any procedure by its name but its purely optional

like u can write

Call txtGuess_Change

or just

txtGuess_Change

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

UCASE Converts the given string to uppercase.


Ex
Dim x as string
x = "America"
text1.text = UCase(x)

here text1 will display the word in variable x but in upper case "AMERICA"

Regards
Shaik Akthar

Lil' Tripsturr commented: thanx +1
aktharshaik 16 Posting Whiz

Hi!
String$ is used to output a string by the specified length for the given character in the second parameter.

Ex:

text1.text = String$(10,"*")

will fill the textbox with ten *

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

I am uploading a sample project for ur reference.

Also make sure that u have selected the CommandType property of the ADODC object.
I have selected it as 2 - adCmdTable.

1. Right click on the ADODC object and open ADODC Properties.
2. In the RecordSource tab select the required command type.
3. And Table or stored procedure name if the RecordSource is "2 - adCmdTable" or "4 - adCmdStoredProc"
or
write the Command Text (SQL) if the RecordSource is "8 - adCmdUnknown" or "1 - adCmdText"


hope this solves ur problem


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Is ur problem solved. If solved then mark the thread as solved.

Anything else u may need feel free to ask anytime.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

I AM UPLOADING A SAMPLE PROJECT HERE FOR UR REFERENCE.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

The hyperlink datatype adds a character '#' in the beginning and ending of the field value.

hence use the hLinkFile variable which holds the value of the Description field by eliminating the unnecessary # character using the Mid function

check if the file exists in the given path in the hLinkFile variable, and if yes then go for opening it and display its data.

put all the variables in the same procedure itself.

Imp: Add the following references.

1. Microsoft ActiveX Data Object 2.1 Library
2. Microsoft Scripting Runtime Library

Dim db As ADODB.Connection
    Dim rst As ADODB.Recordset
    Dim FSO As New FileSystemObject
    Dim FL As TextStream
    Dim hLinkFile As String

    Set db = New ADODB.Connection
    Set rst = New ADODB.Recordset
    db.Open "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & App.Path & "\database.mdb"

rst.Open "SELECT DESCRIPTION FROM EQUIPMENT ", db, adOpenKeyset, adLockReadOnly

    If rst.BOF = False Then
        hLinkFile = Mid(rst!Description, 2, Len(rst!Description) - 2)
        If Dir(hLinkFile) <> "" Then
            Set FL = FSO.OpenTextFile(hLinkFile, ForReading, False)
            Text1.Text = ""
            While Not FL.AtEndOfStream
                Text1.Text = Text1.Text & FL.ReadLine
            Wend
            FL.Close
        End If
    End If

    If rst.State Then rst.Close
    Set rst = Nothing

    If db.State Then db.Close
    Set db = Nothing

    Set FL = Nothing
    Set FSO = Nothing

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

check out the documents attached


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

plz post the fieldnames and the sample data in those fields in the EQUIPMENT table

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

use the following statement in declaring variables
Make sure to add Microsoft ActiveX Data Objects 2.1 Library in references

Dim db as New ADODB.Connection
Dim rst as New ADODB.RecordSet
Dim FSO As New FileSystemObject
Dim FL as TextStream

db.Open "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & App.Path & "\database.mdb"

rst.open "SELECT DESCRIPTION FROM EQUIPMENT ", db, adopenKeySet, adLockReadOnly

If rst.BOF = False Then
  'open the file in the field which contains
  'the hyperlink to the textfile
  'here replace the hLinkField with the hyperlink field actually
  'in ur table

 Set FL=FSO.OpenTextFile(rst!Description, ForReading, False)
 Text1.Text = ""
 While Not FL.AtEndOfStream
  Text1.Text = Text1.Text & FL.ReadLine
 Wend
 FL.Close
End If

Set FL = Nothing
Set FSO = Nothing

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

There is some issue i faced when installing Oracle 8i on Windows XP. All the oracle services are not started automatically. I used to take an alternate route to UP the database.

Try this

Go to command prompt. and type the foll commands

-------------------------------------------------------

C:\>svrmgrl [enter]
'Rem: u will the svrmgr prompt then type CONNECT INTERNAL/ORACLE and hit enter
svrmgr> CONNECT INTERNAL/ORACLE
Connected.

'After getting the connected message type STARTUP and hit enter
'you get few messages and the database mounted message at end.
'once this is done exit the svrmgr.
svrmgr> STARTUP
..
..
..
Database Mounted.

svrmgr>exit
C:\>

-------------------------------------------------------

Now try running ur project.

U may even try to get another version of the Oracle and try it out.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

HEY con is the database object i referenced.
i think u have to use 'db'

aktharshaik 16 Posting Whiz

PLZ POST THE ENTIRE CODE. I'LL JUST CORRECT IT OUT IF ANY MISTAKES.
ALSO UPLOAD THE DATABASE IF U CAN IN ZIP FORMAT.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

u have not closed the quotation marks dear

rst.Open "SELECT Description From Equipment", con, adopenKeySet, adLockReadOnly

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

here in this code it reads only the first record, opens the text file specified in the hyperlink column and displays its contents in the textbox.
Also note what the name of the textbox is in your form. here i have mentioned it as Text1. See that if u too have the same name of the textbox u created or anything else u might have changed the Name property of the textbox in which u r displaying the file contents.

aktharshaik 16 Posting Whiz
Dim FSO As New FileSystemObject
Dim FL as TextStream

Set db = OpenDatabase(App.Path & "\database.mdb")
Set rst = db.OpenRecordset("table") 

'If record found then
If rst.BOF = False Then
  'open the file in the field which contains
  'the hyperlink to the textfile
  'here replace the hLinkField with the hyperlink field actually
  'in ur table

 Set FL=FSO.OpenTextFile(rst!hLinkField, & _
            ForReading, False)
 Text1.Text = ""
 While Not FL.AtEndOfStream
  Text1.Text = Text1.Text & FL.ReadLine
 Wend
 FL.Close
End If

Set FL = Nothing
Set FSO = Nothing

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Run-Time error 438:
Object does not support this property or method with
rst.Open "SELECT hLinkField....." highlighted.
so, i don't know what to do!


Dear Dan,

I added a dummy SQL Query stating that u have to use your fieldname which has the hyperlink and table name which holds the hyperlink column.

replace hLinkField with the fieldname in your table
replace MyTable with the tablename in your database
if any filtering is to be done based on a particular column add the 'where' clause
or just query all the records like "Select * from table"


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Here I assume u know how to connect to your database. i have considered ADODB.Connection object "con" which is global and already attached to the database.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Ok. Plz take some time. I'll upload some sample code in a few hours. I need to prepare some documentation also for ur reference.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Open the recordset. Extract the field with hyperlink and connect it to the File System Object and TextStream

Dim rs as New ADODB.Recordset
Dim FSO As New FileSystemObject
Dim FL As TextStream

rs.Open "SELECT hLinkField FROM MYTABLE WHERE ID = 1", con,adopenKeySet, adLockReadOnly

'If record found then
If rs.BOF = False Then
  'open the file in the field which contains
  'the hyperlink to the textfile
 Set FL=FSO.OpenTextFile(rs!hLinkField, & _
            ForReading, False)
 Text1.Text = ""
 While Not FL.AtEndOfStream
  Text1.Text = Text1.Text & FL.ReadLine
 Wend
 FL.Close
End If

Set FL = Nothing
Set FSO = Nothing

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

s. u can use the file system object and textstream to open a textfile, read the data and display it in a lable or a textbox.

Add the Microsoft Scripting Runtime in the References. Create objects of the following.
FileSystemObject and TextStream


Try out these, if u still cant make the code then 'll be there to help u out.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

if u can tell some specific requirement of what exactly u need, so that we may b precise in helping u out.

Try something out like taking up a small project. say student database. adding and manipulating student records etc.

Plz have a start, then only u will be able to learn very easily.

I am sorry if i have said anything out of ur way. but my sincere advice is first make a start urself, help urself first to make us help u.
Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Try this code

Dim Fso As New FileSystemObject
Dim Fl As TextStream
Dim fName as String

fName = App.Path & "\" & "MyFile.txt"

If Dir(fName) <> "" Then
 If MsgBox("File Exists.OverWrite?",vbYesNo,"FILE EXISTS")=vbYes Then
      Set Fl = Fso.CreateTextFile(fName, True)
 Else
      GoTo ExitPoint
  End If
Else
 'Here True/False is to Overwrite/Not if a file already exists
 'by the name given in fName.
 Set Fl = Fso.CreateTextFile(fName, True)
End If

 Fl.Close

ExitPoint:
 Set Fl = Nothing
 Set FSO = Nothing

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

go through some attachments i had found earlier during the same search as of yours. that's the much i can help.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

also look for some info at

http://extensions.services.openoffice.org/project/pdfimport?intcmp=1549

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

try the following thread from another forum. may be something u can get from there.
Also there is another freeware called ghostscript which if totally free, s its free. u can find it on sourceforge.

http://newsgroups.derkeiler.com/Archive/Comp/comp.text.pdf/2005-08/msg00053.html

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

where exactly do u want to send the data from the serial port. what device is attached to ur serial port. plz focus on the problem so more precise soln can be provided.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

i have attached a vba for excel help file to the following thread. plz have a look at it. u will get to know all about VBA in excel.

http://www.daniweb.com/forums/thread140753.html

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Can you post ur requirement more clearly. i could not get ur exact requirement.
give some exact explanation with some more sample data. is it in VB that u require this?


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

try this, we know that
1 hr = 60 mins
1 min = 60 secs


so

sec = x

mins = int(sec / 60)
sec = sec % 60

hrs = int(mins/60)
mins = min % 60

days = int(hrs/24)
hrs = hrs%24

hence you get

days hrs mins and sec

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

I have attached the VBA help for excel. i think u can find some information for ur assignment.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

CHECK THE DOCUMENTATION IN WORD FORMAT.

Regards

Shaik Akthar

aktharshaik 16 Posting Whiz

U can use the same syntax

'If u want to store diff values in different 
'columns use variant else use ur required
'datatype
Dim arr(5,5) as Variant

'If at any instance you want to resize
'ur array use the following syntax
'Preserve  keyword is optional
'It will help you retain the earlier values
Redim Preserve arr(10,7) as Variant

This is the reference from MSDN below
Used atprocedure level to reallocate storage space for dynamic arrayvariables.

Syntax

ReDim [Preserve] varname(subscripts) [As type] [, varname(subscripts) [As type]] . . .

The ReDim statement syntax has these parts:

Part Description
Preserve Optional.Keyword used to preserve the data in an existingarray when you change the size of the last dimension.
varname Required. Name of the variable; follows standard variable naming conventions.
subscripts Required. Dimensions of an array variable; up to 60 multiple dimensions may be declared. The subscriptsargument uses the following syntax:
[lower To] upper [,[lower To] upper] . . .

When not explicitly stated in lower, the lower bound of an array is controlled by the Option Base statement. The lower bound is zero if no Option Base statement is present.

type Optional.Data type of the variable; may beByte,Boolean,Integer,Long,Currency,Single,Double,Decimal (not currently supported),Date,String (for variable-length strings), String * length (for fixed-length strings),Object,Variant, auser-defined type, or anobject type. Use a separate As type clause for each variable being defined. For a Variant containing an array, type describes the type of each element of …

aktharshaik 16 Posting Whiz

Just place a note explaining the reason for why none of the answers is right. It may actually be a test for u in the assignment whether u can analyse logic or not.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Dear Friend,

Also plz mark all the thread which r being solved as solved not leaving them as unanswered threads.


Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Check Out the Sample Project Here for resizing the window to full screen and restore it back to its original state.

Some more code for Hide/Display the title bar is also added.

Regards
Shaik Akthar