Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




New ActiveX For MX Queries : K-MX


Available here : http://www.katarncorp.com/?kmx




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Transforming Access Queries To SQL Queries
Hello,
Just wondering if somebody can help me out transforming these "Select" statement for MS SQL.

Dim cn As ADODB.Connection
Dim RS As ADODB.Recordset
Dim str As String

Set cn = New ADODB.Connection
Set RS = New ADODB.Recordset
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:SDBSignage ProgramSignage.mdb;Persist Security Info=False"
cn.CursorLocation = adUseClient
cn.Open

'Create an SQL Statement
str = _
SELECT [sku], [Feat1], [Feat2], [Feat3], [Feat4], [Feat5], IIf([Feat1]<>"","l") AS [Bullet 1], IIf([Feat2]<>"","l") AS [Bullet 2], IIf([Feat3]<>"","l") AS [Bullet 3], IIf([Feat4]<>"","l") AS [Bullet 4], IIf([Feat5]<>"","l") AS [Bullet 5]
FROM SignageTable
ORDER BY [sku];


'Execute the statement.
RS.Open str, cn

cn.Close

These "Select" statement only works on MS Access and I'm new to using MS SQL.

ActiveX DLLs,ActiveX EXEs And ActiveX Contro.
Whats the difference b/w them?


Death

ProudToBeMuslim

Help With ActiveX Dll Project, ActiveX Exe And ActiveX Control
help. im using visual basic 6 on win 2000 pro, i am unable to create a
new activeX dll project, activeX exe and activeX control, along with
things missing from the compilation; options window . ohh and also i
cant add a user control, property page, user document. i don't know what
would be missing for me not to use these options, ,, please I need help

Any ActiveX Control Expert Login Here Can Solve My Problem Relating To ActiveX Contro
I am creating an ActiveX control , control is a text box where i want to add Multiline and Scroll Bar Properties in my Textbox ActiveX control, any one of u can help me, plz reply with complete solttion.

Zubair Khan

How To Make My Appication Accepts ActiveX Controls (ActiveX Container)?
Dear all,
May be it sounds strange, But I'm developing a software that the user can generate, delete, resize, move ActiveX controls.

If course the application has 2 modes (Design time and Run time)

It's ok to let the user generate VB buttons, Text boxes, labels ... etc
But how can I let him include his own AcriveX controls that I don't know ?!

I know it's not that kind of question that its answer is; "Take this code" or "Do so and so", But I just want you to direct me to the right way, Because I'm totally don't know any thing about it.

Looking for your thoughts.

Thanks in advance

How To Make My Appication Accepts ActiveX Controls (ActiveX Container)?
Dear all,
May be it sounds strange, But I'm developing a software that the user can generate, delete, resize, move ActiveX controls.

If course the application has 2 modes (Design time and Run time)

It's ok to let the user generate VB buttons, Text boxes, labels ... etc
But how can I let him include his own AcriveX controls that I don't know ?!

I know it's not that kind of question that its answer is; "Take this code" or "Do so and so", But I just want you to direct me to the right way, Because I'm totally don't know any thing about it.

Looking for your thoughts.

Thanks in advance

ActiveX-Error 429-ActiveX Component Can't Create Object
I am having this message when doing interfacing with MATLAB as the following codes
<vbcodes>
Set MatLab = CreateObject("Matlab.Application")
</vbcodes>

What should I do. I am using Windows XP Professional. Is that version doesn't support ActiveX for interface with Matlab?
Tq

3 Queries In 1
hi all

I have three queries regarding various issues in programming:

1. I try to enter the data into the access database using a recordset. It was working fine a day before & today it states the following errors:

error 1 - "Scaling Of Decimal Values resulted in data truncation"
when I try to debug it & press F8 after that, that error is gone & another error comes up
error 2 - "Update or Cancel Update without AddNew or Edit"
after a few moments of debugging (when press F8 & again see the debug screen & remember, no correction made as yet), another error comes up:
error 3 - "Unspecified Error"

Could somebody help me out on any of those errors
Regarding error 1 , the data types in the database are all set to decimal
Regarding error 2, rs.AddNew statement is present.


The other 2 queries have been posted earlier but couldnt get any reply to those:
2. How can I secure the access database using a password.

3. http://www.xtremevbtalk.com/showthread.php?t=152700

I Need Help W/queries
hi ppl im writing a program using ado connection and i decided to open a inputbox and save certain variable there
then i tried to make a query but i think is not workin

Function ClienteCredito() As Boolean
ClienteCredito = False
Dim Query As String
Query = "SELECT * FROM clientes WHERE " & _
"nombre = '" & Trim(name) & "'"

Conexion
Set RecordsetInventario = New ADODB.Recordset
RecordsetInventario.Open Query, ConexionInventario, adOpenKeyset, adLockReadOnly
If RecordsetInventario.RecordCount <> 0 Then
ClienteCredito = True
Else
ClienteCredito = False
End If
RecordsetInventario.Close
Set RecordsetInventario = Nothing
Desconexion
End Function

The part when im quite confused is in the select because i donot know if i have to use trim or i dont have to.
the variable is declared in a module as a string and as i said before i think is just saved on a inputbox
Thanks a lot !!!!

Sql Queries
Hello Everyone,

I need some help writing some simple queries. First, using the "Like" operator. Here is my code:

sSearchString = txtSearch2
sSearchString = "'" & sSearchString & "*'"
sSql = "Select * From Products Where PartNumber Like " & sSearchString & " Order By PartNumber".

This query always returns 1 record WHY?

Next-I need to (Join - Union?) two tables - Suppliers and Contacts. Suppliers is related to Contacts by a one to many relationship. The related field is SupplierId. I need to get "ContactName" with the related "SupplierName".

How can I do this with one query?

Thanks for all replies,

Greg

Web Queries..
Does anyone know whether VB6 can run a web query in the same fashion as excel ? Or in ANY fashion ? Thanks in advance...

Queries???
hi,

Is there anyone able to enlighted me on how to make the VB Program Idle for a few seconds. (Not using Sleep Function)

Thank you!

Queries
hi,

Presently i'm using this Code : "MsgBox "Read".

There is a error using this code, is there any one can enlighted me on what is the problem. Thank alot.

Help With Queries
I have (hopefully) a simple question. I'm sure someone out there can help me out. I want to create a new record within my query that will total my FinalCharges column. I want the new record to be displayed at the very end of the query. Is there any way of doing this??? I know that there is a command when dealing with Reports called RunningSum, but what can I use for a query?

Please someone help.
Thanks in advance.

Queries.
hi,

i have two form in my program. 1 timer in form 1

i wish to disable the timer when i am in form 2.

how can i write the code to this.

Can someone guide me.



thks alot

Queries
hi,

presently i am using this as my public declaration

Option Explicit
Public Lightstate As Boolean
Public Fanstate As Boolean

i have made this codes TVicLPT1.Pin(3) = Lightstate
TVicLPT1.Pin(5) = Fanstate

on my reset button so whenever i unload my form and show back my form, the value still remain.


Actuallt i got another form in my program, i tried to paste this codes into the second form. and when i run my program and i call out the second form, the value has gone.

can help me on this matter.

tks.

Queries.
hi,

I have two seperate VB program.

Presently, i want to combine them together (meaning 2 form into 1 form),

but both of my program is using the same module name (module file name).

When i combine both together, there is error.

I try rename the module name, but when combine and run, there is still error.

Is there anyway to solve this problem.

Thank you very much.

Queries, Pls Help.
hi,

I have a done up VB program.

I run the program after a few month and realise that the command buttons and text box became in a large font size (look bigger) and now it is unable to fit the whole page. ( meaning the bottom of the page unable to access)

I try searching the propertise section but can't help at all.

Is there anyone can help me solve this problem.


Thank you very much.

Queries
hi,
when i load my VB program, my form suddenly shown a large out look, and it seem difficult to cover the whole page.

I there any one can give me this solution.




Thank you.

Queries
hi,

Presently, i'm using UCase to convert the received message on small letters to big letters.

Is there other command which can converts letters as well as ignore the numbers eg. mototr 15, so as to read n compared the message.

below is my code:

Message = UCase(Message)

If InStr(Message, "MOTOR FIFTHTEEN ") Then
Call cmdStepperCW15_Click
Sleep 2000

thank you

Queries
Hi,

Whenever i run my VB program, it always in the minimize appearance.

Is there any ways to make it maximize whenever i run my program.

Any code available for this?

Thank you very much

How Can I Have To Queries?
Hi Friends,
I need to have two queries, how can I fix my error?it says:

Run time error '3705'
Operation is not allowed when the object is open

Appreciet your help,
Elahe

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

Sub Frequency_table()
Dim strSQL As String
Dim Xmin As Double
Dim Xmax As Double
Dim Average As Double
Dim Strmsg As String

Set db = New ADODB.Recordset
db.CursorLocation = adUseClient

For n = 0 To 5

db.Open "SELECT Max(coef2),Min(coef2) FROM tPoints;", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Xmax = db(0)
Xmin = db(1)
Strmsg = " Xmin = " + Format(Xmin, "#.###e-###") + "----" + CStr(Xmax)
MsgBox Strmsg

db.Open "SELECT average(coef2) FROM tPoints;", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Average = db(0)
Strmsg = " Average = " + CStr(Average)
MsgBox Strmsg

db.Close
Next n

End Sub

Queries
Here we go again - Lets see if I can explain this correctly.
I have 1 query that is similar to this:
Select * from Table where Id = <<a choice made on a form>>
I am trying to use the Data Environment feature of VB6 and cant figure out how to create this query.
I also need to have another query that links to the results of this query - How do I create this second query using
the Data environment?

Thanks,
Derrick

SQL Queries On DAO
How do I sort a DataGrid that uses a DAO? I've been able to do it using a ADODC, but I cannot using a DAO.

Here's how I did it using a ADODC. Can I use the same code, just changing the ADODC with data1?

With ADODC.recordset
.sort = "PCode"
End with

Preferably, if anybody knows how I can use an SQL execute command, please tell me!!


Knows a little about a lot

SQL Queries
I am new to working with Access, and I'm wondering if someone can give me some advice on how to retrieve some information from the Biblio database. I am looking to display all authors in a DataGrid and then display all of the books by that author in a DataList. I am unsure of the INNER JOIN commands necessary to accomplish this. Thank you.

ADO SQL Queries
I have a problem querying using SQL thru ADO

I try to create a search form, using a Datagrid, a text field, a button and a ADO Connection

here´s my code:

Private Sub Command1_Click()
Adodc1.RecordSource = "Select * from ALUMNO where CI_ALUMNO="& clng(Text1.Text) & ""
DataGrid1.Refresh

End Sub

my ado connection (adodc1) uses no Recordsource since I use the SQL query to establish from which table it´s gonna take the data from

I connected the datagrid1 to ADODC1 when I run it it pops up a message error about no text procedure has been set

Thxs a lot

Help With SQL Queries
Hi,

I'm new to SQL and usually use VB to manipulate access databases (in a basic way).

I am using a new applicatrion generator which looks at an Access database, but it does so only using SQL statements so I'm on the learning curve.

My requirement is I have a table with 4 columns :RefNumber, Filename, Date, Status

Now, I want to find out what the last RefNumber is in the table. In VB it is quite simple. I do a RS.movelast and then look at RS.Fields("RefNumber")

How do I acheive the same thing using SQL ??

Many thanks

Simon

Two Queries Into One?
How can I combine the two below queries in Access 2003 where I need to know if none, one or both of the queries got a hit from form entries taken from a Web page:


Code:
select * from mytable
where firstname = 'formvariable.pocfirstname'
and lastname = 'formvariable.poclastname';

Code:
select * from mytable
where firstname = 'formvariable.supfirstname'
and lastname = 'formvariable.suplastname';

SQL Queries
I am having a bit of bother trying to get the most out of my SQL queries. Could someone explain why the following is invalid in SQL server and MS Access (I am interested in using queries of this type for both).


Code:
SELECT MemInfo.[Name], MemInfo.Balance, MemInfo.MaxCash FROM MemInfo WHERE MemInfo.MaxCash > SUM(MemInfo.Balance) ;
To my mind this is a perfectly valid querie but it throws up an error in both SQL Server and Access. With SQL Server saying "-2147217900 - An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference."
?|(

Queries
i am new on vb could someone help me on how to make a queries ?!? i find vb very confusing as i am use to access

thanks
tanya

Wmi Queries?
Does anyone knows where can i find a full list of wmi queries?
I'v searched about them but never found a detailed list...

VSS Queries
we are team of four programmers .

we just started using VSS .

database is created , users are created .

and working folder is setup at common place for all users

What is the best of setting up VSS ?

should we have a common working folder or different ?

whenever i check out any file , does it gets from the vss
database or just makes it editable in the working folder ?

How to make sure that any file i am editing is of latest version ?

Queries
Why when i do


Code:
Select Top 100 * From Customer Order by Field1



it takes more than 3 minutes.

And if i do

Code:
Select Top 100 Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10 From Customer Order by Field1


it takes less than a second

SQL Queries
Hey Guys
I need to learn about how to do the following

1) I have a field called amount in a table, how can I add $100 to all the values in the amount field by writing a SQL statement?

2) how can I add another column to my table during run time using SQL statement?

3) How can I rename the database using SQL statement

Thanks

Using Sql Queries....
my application is linked to a database and I want to perform this query if a option button is chosen ... how?


Code:

If Option1(0).Value = True Then

' SELECT Customer.LName, Customer.FName From Customer ORDER BY Customer.LName;

End If


any suggestions?

Queries
I need two queries:

a) One that would retrieve all the records that have a special field duplicated.

b) One that would retrieve the record previous record and next record of a missing index.

Am I clear?

DNS MX Queries
I am looking to query a DNS for MX records using Winsock but am unable to find any examples of constructing the query using VB6. Can anyone give me examples of this or have any code themselves showing the procedures?

Many Thanks
Paul

SQL Queries
Are there any changes to the SQL queries when you access the database on the SQL Server? When I run my application, I can't seem to access the queries. What happened? What are the changes needed when running the application from Access DB to SQL Server DB? Thanks.

A Few Queries
Hi,

I have written a simple small program for work that deletes a few settings files and then launches a program.

note: I have compiled it on my Win98 machine but at work we use Win NT.

When I run it at work it says 'component COMDLG32.OCX or one of its dependencies not correctly registered a file is missing of invalid'... any ideas what this is all about??

I did a search for the file and found it in C:winstall

When I try running it on another machine it runs and then when launching the other program gives errors that it can't load files associated with the program its launching... surely if my program has ended, launching the program should run as normal?!

Hope someone can help.... thanx!

Queries
My problem is that I am querying a DB according to what a user places in it. It works great until I try to query all of the offices (strCSO). As you can see below I am using a case statement to query determine what the user puts in. The problem ossurs when I try to place all of the offices in the strCSO string it crashes. This is done in ASP...Any thoughts..

*********************************************


Select Case strSort
case "Unit"
strQ = "Select * from tblEmp where phone <> null and ACES_USER <> null and site in ('" & strCSO & "') order by Unit ASC"
case "LName"
strQ = "Select * from tblEmp where phone <> null and ACES_USER <> null and site in ('" & strCSO & "') order by LName ASC"
case "Phone"
strQ = "Select * from tblEmp where phone <> null and ACES_USER <> null and site in ('" & strCSO & "') order by Phone ASC"
case "FSS_Level"
strQ = "Select * from tblEmp where phone <> null and ACES_USER <> null and site in ('" & strCSO & "') order by FSS_Level ASC"
end select
************************************************

strCSO is the office number (determined with the first combo box) and strSort is the second comb box, what you see as possible cases are values therein.

SQL Queries
What code can I use to go from my VB program to open a Query in the Queries section of the Access Database. I have every thing set up, but call the query from my program. Any help will be much appreciated.

Regards

Steve Elliott
South Africa

Queries
Hi all

I have database contains table and query , by Adodc i can use table by select AdCmdTable from Command Type , by i can't do that with query , if you know i searched about it in all command types,

help me please ,

Thanks

SQL Queries
Is there a way of using just on SQL command ie just open one recordset . . . ?


Code:

Set oDB = OpenDatabase(GetSetting("DBDETS", "DATABASE", "PATH", "X"))

SQLStr = "SELECT DISTINCT tbl_Archive.[Result] FROM tbl_Archive WHERE tbl_Archive.[Success]='" & sType & "';"

Set oRS = oDB.OpenRecordset(SQLStr)

If oRS.RecordCount <> 0 Then

With oRS
.MoveLast
.MoveFirst
sTemp = sTemp & UCase$(sType) & " SUMMARY REPORT " & dStart & " TO " & dFinish & vbCrLf & "-----------------------------------------------------" & vbCrLf
iFile = 0
Do Until .EOF
sRes = oRS("Result")
sSQL = "SELECT * " _
& "FROM tbl_Archive " _
& "WHERE tbl_Archive.[Rundate] BETWEEN #" & Format(dStart, "m/d/yyyy") & "# AND #" & Format(dFinish, "m/d/yyyy") & "# " _
& "AND tbl_Archive.[Result]='" & sRes & "';"

Set oRSTMP = oDB.OpenRecordset(sSQL)

With oRSTMP
If .RecordCount <> 0 Then
.MoveLast
.MoveFirst
iFile = iFile + .RecordCount
sTemp = sTemp & sRes & ":: RECORDS FOUND = " & .RecordCount & vbCrLf
End If
End With
.MoveNext
Loop
End With

End If

SQL Queries
How can I write a multiple conditional SQL expression? The problem is that the user types in the 2 expressions to cross reference.

ADO.NET And SQL Queries
I am trying to do a join with ADO.NET. I have tested this Query is both Access and SQL Server and it works fine so I am thinking I missed something on my form. Here is the query it ain't pretty and may not be the best way to do it but it works. I think my error has to be something with the connection on my VB.NET form. It is one of those errors that drive you nuts cause the solution will probably have nothing to do with the query.

PHP Code:





 SELECT Sales.SalesID, Sales.WinningBid, Items.Location, Items.Description, Bidder.BidderNumber, Bidder.Name, Bidder.Address, Bidder.City, Bidder.State, Bidder.Zip, Bidder.Phone
FROM (Bidder INNER JOIN Sales ON Bidder.BidderNumber = Sales.BidderNumber) INNER JOIN Items ON Sales.ItemLocation = Items.Location
WHERE (Sales.BidderNumber = '1') 






Here is my error if it helps at all.

PHP Code:





 Syntax error (missing operator) in query expression 'Bidder.BidderNumber = Sales.BidderNumber INNER JOIN Items ON Sales.ItemLocation = Items.Location'. 






Now what I have found out is if you use the DataAdapter control it does not do multiple joins really well. What I had to do is program this through code with out controls. When I added the multiple join to the DataAdaper it would rewrite it like this.

PHP Code:





 SELECT Sales.SalesID, Sales.WinningBid, Items.Location, Items.Description, Bidder.BidderNumber, Bidder.Name, Bidder.Address, Bidder.City, Bidder.State, Bidder.Zip, Bidder.Phone
FROM Bidder INNER JOIN Sales ON Bidder.BidderNumber = Sales.BidderNumber INNER JOIN Items ON Sales.ItemLocation = Items.Location
WHERE (Sales.BidderNumber = '1') 






This would give me the error stated above. So if you are having trouble getting more complex SQL Queries to work with the DataAdapter you may nee to skip the easy way out and do this through code and it should work just fine.

Several Queries
It would be very helpful if someone could help me with a few problems I am having with my program:

- I have a form that needs to calculate the the total cost. There is list box that has all the prices in for items in a order, I would like all these prices to be added up and shown in a total price text box so that when new prices are added and prices are removed the total price stays updated with the correct total. How can this be done?

- I then want the items from my items ordered and price list boxes, the current date and the total price to be shown on a new invoice form when a command button is pressed. How can this be done?

- Finally I then want this invoice form to have a Print command button that when pressed will print the form and add the date and total price to a serial file. How can I do this?

I'm really stuck with this and I have no idea, any help would be greatly welcome.

Thanks

SQL Queries
Here is my issue, I am referencing an SQL query through a command in the dataenvironment. My question is, where and how do I use a wildcard to return values? For example, I am looking for all companies in a table that begin with "Her" here is the command code I am using but I have to enter the exact name of the company to find it...ie. "Heritage Enterprises" - where txtCompany is the variable I am using.

Private Sub cmdFilter_Click()
' run the query, passing the expected parameters.
DataEnvironment1.SearchCompany txtCompany, txtLocation, txtConfname1

' Ensure the grid is bound to the DataEnvironment
Set DataGrid1.DataSource = DataEnvironment1
DataGrid1.DataMember = "SearchCompany"
End Sub

any ideas anyone? is it something I put in the code here or do I do it in the SQL query???

help! I'm really new at this all, sorry!

Queries In VB
once i create queries from tables, using either access or visual data manager, how can i operate on those queries within my vb modules?...do i do that the same way i would operate on regular tables within the database?

Queries
I currently have an access query that references tables in different
DBs. This query does a lot of calculations and a lot of the machines
that this is running on cannot process the query due to the heavy amount
of data Access brings back to the client to process. I would like the
server to this work but being new to the world of SQL, I have not found
information that would allow me achieve a stored procedure or a view or
whatever else there is that would allow me to run this type of query on
the server.



If somebody has any advise, please share.



Thanks,

Chris

Copyright © 2005-08 www.BigResource.com, All rights reserved