Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. DangerPowers

    Stored procedures Performance

    The optimal solution is, of course to have separate compiled queries, but I can understand your pain in managing so many objects. You should probably leave the WITH RECOMPILE option on. Most of the time, a bad query plan is worse than recompiling. Try this article to see if there is anything...
  2. DangerPowers

    Using Like % and form control to build SQL Stmt.

    Try setting the whole thing to a variable first, then assign the variable to the rowsource: strSQL="SELECT colA, colB, colC FROM tbl WHERE colA LIKE '%" & form.control & "%' ORDER BY colA"
  3. DangerPowers

    Making an SP not to return a result set

    I think want you want to use is the SET FMTONLY ON command.
  4. DangerPowers

    Using Serial Tablets

    Try using the Microsoft COMM control to deal with the COM port. Check out http://msdn.microsoft.com/library/en-us/comm98/html/vbobjComm.asp for more info on the COMM control.
  5. DangerPowers

    Alphanumeric sorting

    Try the shellsort algorithim at vb2themax: http://www.vb2themax.com/Item.asp?PageID=CodeBank&Cat=130&ID=18 You may need to alter to convert the value to a number so it sorts properly. With the values you are using, it will perform a sort where 10-0-1 comes before 7-0-1.
  6. DangerPowers

    SQL, ODER BY

    Try converting the position column to a number in the order by clause: SELECT position FROM orderpositions ORDER BY cast(position as int) ASC
  7. DangerPowers

    SQL Server Performance

    If designed properly, things should be ok. Monitor the performance, and check http://www.sql-server-performance.com for suggestions if you see degredation.
  8. DangerPowers

    Set values for class property

    Declare a Public Enum and make the property use that enum as the variable type. Check out http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vastmenum.asp for more information
  9. DangerPowers

    Hoe do I Send EMail Attachements via Winsock ?

    The easiest and simplest way is through the use of the CDONTS Newmail object: Dim myMail Set myMail = CreateObject("CDONTS.NewMail") myMail.From = "Example@microsoft.com" myMail.To = "Someone@microsoft.com" myMail.Subject = "Sample Message&quot...
  10. DangerPowers

    SP ERROR: Procedure or function ORDER_ACTIVITY_REPORT has too many arg

    It looks as if you have two input parameters: CREATE PROCEDURE [dbo].[ORDER_ACTIVITY_REPORT] @startdate as datetime, @enddate as datetime But you are running it with 4 with the not null check: exec order_activity_report '2002-08-01', '2002-08-07', '%van dyk%', '%840%' Try adding the @name...
  11. DangerPowers

    Time using masked edit control

    The mask property of the control can be set to ##:##:## ??. However, the control can only distinguish between numbers and letters. The user could enter 99:99:99 XX. You would still have to validate the time with the IsDate() function. If you are going with an ActiveX control, try the DTPicker...
  12. DangerPowers

    Date functions

    You can use the datepart() function with "w" as the day of week interval: datepart("w", now())
  13. DangerPowers

    Returning an 'increment identity' field from Stored Proc to VB

    Without using output parameters (the most efficient way to go), at the end of your stored procedure, just do: select @@Identity This will return the identity that was create in the insert.
  14. DangerPowers

    Calculated Date Default Values

    A quick solution: select cast(cast(datepart(month, dateadd(month,1,getdate())) as varchar(2)) + '/1/' + cast(datepart(year, dateadd(month, 1, getdate())) as varchar(4)) as datetime) Note: It's important that the new date (i.e. dateadd(month, 1, getdate()) is used for the year portion since...
  15. DangerPowers

    SIMPLE --> Default value in result set

    To set a value when a column is null, use the IsNull() function: select field1, IsNull(field2,'Default2') as field2, field3 from table1 where field1='value'
  16. DangerPowers

    how do u disable that 'tooltip' function in a treeview

    Found a better, easier way: Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _ (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias...
  17. DangerPowers

    how do u disable that 'tooltip' function in a treeview

    A somewhat decent article that explains notifications and has an example of using the treeview control: http://www.vbbox.com/codebox/articles/article002.htm
  18. DangerPowers

    Finding missing records...

    Technically, the @newtable is a table variable and is not a temp table...:-) However, without a temporary storage area here, I can only see using a cursor and looping through and checking each row for existence and building a string of items not in the list.
  19. DangerPowers

    How to reterieve the AM or PM part of a time when using Now function.

    The hour() function returns an integer between 0 and 23 regardless of the type of clock used. The now() function returns the date-time depending on the way Windows Regional settings are used. I actually have a 24 hour clock and right$(now,2) returns the seconds.
  20. DangerPowers

    Finding missing records...

    You already have a Temp Table #SOAP, but that can be any other table with the values or a table variable so as to avoid the temp table constraint. Try this (uses #SOAP): --create some base data CREATE TABLE #Soap (nID int) INSERT INTO #SOAP VALUES(1) INSERT INTO #SOAP VALUES(2) INSERT INTO...

Part and Inventory Search

Back
Top