vb5prgrmr 143 Posting Virtuoso

You posted the code... take a look at what you posted and my suggestion...


Good Luck

vb5prgrmr 143 Posting Virtuoso

You posted the code...

vb5prgrmr 143 Posting Virtuoso

Well, if you have detached the database then you should be able to attach it through a statement to the master db but you will need admin privledges.

Then, if you are trying to rollback your database to a previous point there should be a rollback statement you can use...

Try this forum, they may be able to help you with the commands a bit better than I can at the moment becaues this computer does not have my SQL help files on it...

http://www.dbforums.com/


Good Luck

vb5prgrmr 143 Posting Virtuoso

In vb6 you can't. You can however use the tab order to specify the order of the controls as they are tabbed to. Also command buttons when you hit enter activate the click event. Then you can reduce your code for textboxes if you use arrays.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Oh!!!....

I think I know what you are trying to say now....

You are trying to create a CSV file for excel to open aren't you???

Okay, then...

Print #1, crseid & "," & crseno + "0"

Good Luck

vb5prgrmr 143 Posting Virtuoso

Don't know what to tell you. I tried this...

Dim FName As String, FNumb As Integer
FName = "c:\z\temp.txt"
FNumb = FreeFile
Open FName For Output As #FNumb
Print #FNumb, "test", "Test"
Close #FNumb

and got 10 spaces between each test. Then I tried this...

Dim FName As String, FNumb As Integer
FName = "c:\z\temp.txt"
FNumb = FreeFile
Open FName For Output As #FNumb
Print #FNumb, "test", FNumb + 0
Close #FNumb

and got eleven spaces between test and 1

Now, if you are trying to add a zero to a string then you should use the ampersand character (&) and not the addition character (+) or if you are trying to add a zero to a number then you should str(numbervariable) & "0".


Good Luck

vb5prgrmr 143 Posting Virtuoso

Well, you can set the format from the DTP or you can use the functions I mentioned above and when you query you may need to use the # symbols around the date if access.

Anybody else want to pipe in???


Good Luck

vb5prgrmr 143 Posting Virtuoso

SELECT INTO staff_badgeTracking (400001, 12345, nana)
SELECT staff_badgeTrackingNew.400001, staff_badgeTrackingNew.12345, staff_badgeTrackingNew.nana FROM staff_badgeTrackingNew


Good Luck

vb5prgrmr 143 Posting Virtuoso

Here is a way to check to see if the server is up and running...

http://www.tek-tips.com/viewthread.cfm?qid=1560292&page=1

which should be sufficient for your needs.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Only problem is the hard drive serial number can change like when you reformat the hard drive. It is also able to be changed through code. So making a serial number based upon this will cause problems not only for your customer but for you.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Well good luck with either this method or the SQL/mySQL method.

vb5prgrmr 143 Posting Virtuoso

Data Form Wizard...

You will find this under Add-Ins>Add-In Manager


Good Luck

vb5prgrmr 143 Posting Virtuoso

Easiest way is to have then purchase crystal reports designer and you just add the necessary references to your project. That way you will have distributed the necessary dlls and such to each of their machines that use your program but they only need to purchase one seat license to create the reports. Then they drop the reports into your report directory and your program reads the contents of this directory and your program lists their report in your program. Use the Dir function to read the directory.


Good Luck

vb5prgrmr 143 Posting Virtuoso
Print #1, crseid, crseno + "0"

Good Luck

vb5prgrmr 143 Posting Virtuoso

Do you mean something like this???

Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text2.SetFocus
End Sub

Private Sub Text2_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text1.SetFocus
End Sub

or like this???

Private Sub Text1_KeyUp(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
  Index = Index + 1
  If Index > (Text1.Count - 1) Then
    'code to set focus to next control
    Text2.SetFocus
  Else
    Text1(Index).SetFocus
  End If
End If
End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

It looks like you are trying to pass a date in the format of day month year. For this to work your database needs to be in the same format and most databases use the format of month day year.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Are the fields numeric? If not that could be your problem but without seeing your code who knows.


Good Luck

vb5prgrmr 143 Posting Virtuoso

What do you mean restore?

vb5prgrmr 143 Posting Virtuoso

Once you have compiled your code into an executable use the Package and Deployment Wizard to package up your project or use Inno (free). It should add all the required dependencies to the setup package but you will have to add the reports manually (both the PDW and INNO have the ability).


Good Luck

vb5prgrmr 143 Posting Virtuoso

avisek_cts,

I'm glad to see you created your own post so ignore my comments in the other thread you perhaps accidently posted to. Next time if you do something like that, click on the Flag Bad Post link and explain your boo boo.

Switch these two...

AcroExchApp.GetActiveDoc
Set AcroExchApp = CreateObject("AcroExch.App")

to

Set AcroExchApp = CreateObject("AcroExch.App")
AcroExchApp.GetActiveDoc

because you are trying to give the object a command before you have created it.


Good Luck

vb5prgrmr 143 Posting Virtuoso

abisek_cts,

In the future please create your own thread and if you need to, copy the older threads url that you want to reference into your post.

Also please use code tags when submitting code. [ code ]your code goes here[ /code ] (without spaces as shown)

Now, I think you need to switch these two lines...

AcroExchApp.GetActiveDoc
Set AcroExchApp = CreateObject("AcroExch.App")

to

Set AcroExchApp = CreateObject("AcroExch.App")
AcroExchApp.GetActiveDoc

because you have not create the object yet and are trying to give it a command.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, let me explain this a little further...

In client program you have two text boxes for user name and password. User enters this information and you build a string to send to the server program. For giggles sake, lets say that this is the string you assemble...

StringVariable = "u=Demi Moore|p=boy toy ashton"

Now you send this string to the server application and when the server application recieves it, it uses code something like this...

Dim CommandArray() As String
Dim LowerBoundsOfArray As Integer, UpperBoundsOfArray As Integer
Dim ForLoopCounter As Integer

Dim UserName As String, Password As String, QueryString As String
Dim UN As Boolean, PW As Boolean, QS As Boolean

Dim CommandString As String, CS As Boolean, BC As Boolean

CommandArray = Split(StringVariable, "|")
LowerBoundsOfArray = LBound(CommandArray)
UpperBoundsOfArray = UBound(CommandArray)

For ForLoopCounter = LowerBoundsOfArray To UpperBoundsOfArray
  If UCase(Left(CommandArray(ForLoopCounter), 1)) = "U" Then
    UserName = Mid(CommandArray(ForLoopCounter), 3)
    UN = True
  ElseIf UCase(Left(CommandArray(ForLoopCounter), 1)) = "P" Then
    Password = Mid(CommandArray(ForLoopCounter), 3)
    PW = True
  ElseIf UCase(Left(CommandArray(ForLoopCounter), 1)) = "C" Then
    CommandString = Mid(CommandArray(ForLoopCounter), 3)
    CS = True
  ElseIf UCase(Left(CommandArray(ForLoopCounter), 1)) = "Q" Then
    QueryString = Mid(CommandArray(ForLoopCounter), 3)
    QS = True
  Else
    'bad command
    BC = True
  End If
Next ForLoopCounter

If UN = True And PW = True Then
  'log in
ElseIf CS = True Then
  'execute command string
ElseIf QS = True Then
  'execute query string
ElseIf BC = True Then
  'notify client that a bad command was passed
Else
  'something wrong
End If

Good Luck

vb5prgrmr 143 Posting Virtuoso

It looks fine to me but here are a couple of things to check before you execute your SQL statement...

1) Check the connection to make sure it is open
2) Remove the space before select (really should not have to but what the he.. if you know what I mean).
3) check in help files to make sure that a static rs is valid with optimistic locking


Good Luck

vb5prgrmr 143 Posting Virtuoso

SELECT INTO staff_badgeTracking (Field1Name) SELECT ...

You need to use the name of the field in between those parens without any single ticks ', then it should work for you.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Text1.text = "some string"
Text1(Index).Text = somestringvariable


Good Luck

vb5prgrmr 143 Posting Virtuoso

see post #2 above, it gives step by step


Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, well if you are bent on using winsock then the process would be something like this

Client gathers user information (password, username)

Client opens/connects/sends user info to server

Server Recieves user info and based upon predefined switches or delimeters server parses out (username, password) from information. Then checks that information against database.

If found Then
Server sends back success
Else
Server sends back failure
End If


Good Luck

vb5prgrmr 143 Posting Virtuoso

Ahh... that should be...

To get last on use a select top 1 field from table order by unique ID (auto number field) DESC


Good Luck

vb5prgrmr 143 Posting Virtuoso

Wrong forum you need the .NET forum

vb5prgrmr 143 Posting Virtuoso

You may need to use the SetPrinter API if you cannot set a custom paper size through the printer object.

And if you use crystal reports then you will have to also specify a specific paper size there also or you will get multiple "pages" of blanks.


Good Luck

vb5prgrmr 143 Posting Virtuoso

How does it not work?

and should that not be ([exam fee] + [other fee])

Good Luck

vb5prgrmr 143 Posting Virtuoso

Then you will need to create a listening program on server that will recieve data and command from client and the server program will execute these and/or return results/errors to client programs.

Much easier to use internet connection via ADO on a higher end db.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Use findwindow to get the handle of the window and then use SendMessage with WM_SETTEXT const. (You can't supply this info in the bat file?)


Good Luck

vb5prgrmr 143 Posting Virtuoso

Format function, FormatDate Function...


Good Luck

vb5prgrmr 143 Posting Virtuoso

SELECT INTO Table2 (Field1, Field2, Field3) SELECT Table1.Field1, Table1.Field2, Table1.Field3 FROM Table1

As table2 already exists.


Good Luck

vb5prgrmr 143 Posting Virtuoso

To get last on use a select top 1 field from table order by unique ID (auto number field)
Break it apart with split on the - character
Use the upper bound of array (1) with the val function to put value into a variable.
variable + variable + 1
StringVariable = Format(variable, "0000")
stringvariable = LowerBound of array (0) & "-" & stringvariable
'...


Good Luck

vb5prgrmr 143 Posting Virtuoso

1) Remove the Dim fs from inside the loop
2) When concatinating string use the & character as the + is for additon of numbers
3) Debug.Print Val("10 pencils")


Good Luck

vb5prgrmr 143 Posting Virtuoso

Looks good but query should not be in keydown event as every keypress will make your query run. Use any of the following so the msgbox does not pop up.

1) test the length in the textbox to make sure the minimum number of required character are entered (in this keydown event)

2) use lost focus event of text box

3) use command button to do the search


Good Luck

vb5prgrmr 143 Posting Virtuoso

Can't use a for each...

Dim I As Integer
For I = 0 To Printer.FontCount - 1
  Combo1.AddItem Printer.Fonts(I)
Next I

For I = 0 To Screen.FontCount - 1
  Combo2.AddItem Screen.Fonts(I)
Next I

I believe that screen.fonts will return more fonts (at least on my computer). Check the count on yours. Also, they do not come ordered so you should make sorted = true.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Why go through winsock? You don't need to unless you are trying to do this over internet (ie. not lan) and then if you are doing this over the internet then there are many technologies that will allow you to do this via a thin client (think asp). Also, if internet, dao and access are the wrong technologies to use. You would want to use ADO and at least MySQL.

So in short, you do not need the winsock to connect to an access database via dao.


Good Luck

vb5prgrmr 143 Posting Virtuoso

While I have been a customer of various printing places I know very little of what goes on behind the scenes so I have to ask a couple of questions that may help you in determining a value for your product.

Does your product tie into anything that can help automate any portion of any process? Like can it control a silk screen machine or a heidelburg.

Does this process of yours streamline the backhouse procedures in such a way as to make certain positions more productive and thus the company would need less labor?

Does this program/process allow for off site ordering?

Does this program allow for off site synchronization with home/main database?

Does this program allow for the customer (onsite and offsite) to see a graphical representation of what they want?

Does this program tie into various accounting systems or does it have its own accounting system?

Does this program have any reports that can show the division between labor, inventory, sales commision, profits, etc?

Does program allow for customization? ie. word excell etc?

Does program or is program a logical step towards the mythic paperless office?

Opinions...

If program is able to reduce labor then perhaps the price should be based upon a small percentage of labor saved.

If program only automates orders then a small price with a small recurring fee for upgrades, customer service, etc. might be appropriate with extra charges for customization.

vb5prgrmr 143 Posting Virtuoso

Okay, the reason your access database/vb6 creates that error is because VB6 is quite dated and to resolve that problem you would need to save your database to a previous format. Once that is done you should be able to run the wizard but as for converting back to the database format you want to use, I don't think the ADODC will be able to handle then new format (maybe it will if you change its connection string through code but I have never tried, I always use code).


Good Luck

vb5prgrmr 143 Posting Virtuoso

If you need a tutorial there are nearly hundreds out there...

http://visualbasic.freetutes.com/learn-vb6-advanced/lesson8/

Now, as for your code I see that on this line...

conn.ConnectionString = connString

you do not have connString defined anywhere nor can one see what if any value connString holds and then on the next line were you do...

conn.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=PostgreSQL30;Initial Catalog=PostgreSQL"

Well! That is your connection string!

So have a look at a tutorial or use the data form wizard with an ODBC DSN then see http://www.connectionstrings.com to change your connection string to a DSN Less connection string.


Good Luck

vb5prgrmr 143 Posting Virtuoso

While this tutorial is about using the clipboard to move data from an excel spreadsheet to a flexgrid, the information on opening the spreadsheet is in there.

http://www.vbforums.com/showthread.php?t=393082&highlight=excel+tutorial

Good Luck

vb5prgrmr 143 Posting Virtuoso

Those results show you how to plot a graph with values added to the code. If you also need a data access tutorial, then there is one on this site and many more out there on the web.


Good Luck

vb5prgrmr 143 Posting Virtuoso

6th line down has an exit sub right after the end if on line 5. From what I can tell this is executed so the rest of the code is not. Also, your inner join query is incomplete and will/should raise errors when you attempt to try to open it.


Good Luck

vb5prgrmr 143 Posting Virtuoso

so replace it with your textbox.text... I could for money but will not do it for you for free. You must learn how to connect the dots yourself sir. You have all the information so please use the right (?) side of your brain. (Right side is logical side right???)


Good Luck

vb5prgrmr 143 Posting Virtuoso

Normally, on a MS network that uses TCP/IP, the named pipes protocal is also installed and is used as a secondary protocal. Now, SQL server is very use to this protocal and normally when you create an ODBC DSN it is via named pipes but you can specify other protocals when you create it.

So, first off, I would suggest just as an experiment, to see if you can create an ODBC DSN from one computer to the server. Don't forget to test the connection to make sure it works.

Then if the ODBC DSN does work then yes you do have to tweak your connection string some...

Search the web for vb6 connection string builder

and this is a vb6 add-in someone made

http://www.vbforums.com/showthread.php?t=243215&highlight=connection+string+builder

There are a couple more out there also...


Good Luck

vb5prgrmr 143 Posting Virtuoso

See previous post!!!!!!!!!!

vb5prgrmr 143 Posting Virtuoso

try something like....

SELECT * FROM Table1 WHERE (Date1 >= DTP1.Value AND Date1 <= DTP2.Value) AND (Date2 >= DTP1.Value AND Date2 <= DTP2.Value) AND (Date3 >= DTP1.Value AND Date3 <= DTP2.Value)

Which is or should be the same as the between statement and if this does not work use access's query design window to help you create the query one step at a time.

Good Luck