Not 100% sure what you are trying to return but try this. You can substitute the GetDate() for a date field within a table. Also I would not use int's to store dates use an Sql server datetime one instead.
Hope this helps,
Regards, Nick
SELECT '10' AS...
I agree with Peters recommendation, go with Janus. It handles all the data for you. Zemp is quite right that the flex grid can be setup as an editable grid using text boxes positioned over the cells, although it works I feel it makes the app look a tad clunky in operation. If you do go this...
Marco,
Try this as an execute query to the database,
Dim cSql As String
cSql = "ALTER TABLE Table1 ADD COLUMN FieldName Text(20)"
CurrentDB.Execute(cSql)
The execute may not be quite right but the SQL is correct.
Hope this helps
Regards, Nick
I agree with Peters comments and would add you need to change the newrs.CursorType = adOpenStatic statement to be either adOpenKeySet or adOpenDynamic. Static recordsets support scrolling forward and backward; changes made by other users are not visible.
Regards, Nick
MDA,
Just saw this in SQL Server 2000 help file. I think after completing this you can then query the other database using a single connection so it could make your transfer of data easier.
Regards, Nick
How to set up a linked server (Enterprise Manager)
To set up a linked server
Expand a...
MDA,
One method could be to change the SP, place new data created by the SP in to a temp table then use VB to query the temp data and then insert to second server using seperate ADO connections. Or you could set up replication on the first server to create / update the tables on the second one...
I can't see anyway of using ADO to do this in one execute, unless someone knows different. You could however use the code below. You'll need to set a ref to MS Access 9.0 Object Library - this may well work for you.
Regards, Nick
Public Sub ImportText(FileName)
Dim Acc As New...
Sorry, see what you mean. The db.Execute "INSERT INTO returns SELECT * FROM rsWorkFile" will not work because the query is looking for a table named rsWorkFile because it is enclosed within the quotes. I don't know if it is possible to query a flat file and insert to a table in one SQL...
I assume your using ADO, is so set a reference to MS Jet and Replication Objects, this allows you to link tables.
Below is a small section of code I use, you should be able to pick the bits out you need to make it work for you.
Regards, Nick
For Each tblMST In cat.Tables
If tblMST.Type...
Hi,
The problem is your Execute, it's trying to INSERT into a table within the connected database and as returns is not a valid table name you are getting the error.
I suggest you insert the data you require from the recordset and the flat file then run a query to select the data from the temp...
Hi,
Access is a real pain with this problem. It's to do with a cache setting within the registry, even if you change it, it makes no difference. To get round it make a reference in your VB project to Microsoft Jet and Replication objects.
Dim JRO As Jro.JetEngine
' After updates, executes etc...
Hi,
Try this - it works fine for ADO against Access or SQL server dates.Note date is wrapped by single quotes for SQL server, for Access replace single quote with #. If you always use the format below by using mmm then regardless of database date order it should still work. One final point, only...
Hi,
You'll have to use the VB Printer object to print it, you can't do a huge amount of formting with it but you can open the file and between the file read lines add Printer.FontBold = True
Printer.Print MyTextLine
Printer.FontBold = False
You can also use TAB() as well eg.
Printer.Print...
horak,
your delay (especially with Access 2k) for the first record is where the table is being opened and cached. The subsequent inserts are usually fairly quick. I would however, for performance split the tables down to a more manageable level. This would help in recorset performance. Also with...
Brandon,
I've had similair problems with ADO updating an Access database. To get round adding in delays all over the code I set a reference to Microsoft Jet and Replication Objects, in code have DIM JRO As New Jro.JetEngine. Then after inserting rows using execute method add the line...
Have a look at the stored procedures SP_Who and SP_Who2, this will tell the logins currently active within SQL server plus a whole load of other information. You can return this data to a recordset within VB.
Regards, Nick
Following on from Ladyhawk you may also need to test the value set for IDTable1 if you have a unique key on this field, if you do and the value for IDTable1 already exists within the table you will get an error. So within the insert module / function make sure you have adequate error trapping...
Hi,
Placed your code in to VB and changed the MDB to an Access 2000 one I have and it worked Ok to a point. Your test for EOF will not work if more than one record is returned as it will not be true. Try changing the test to be :-
If Not (rsProblem_ID.EOF And rsProblem_ID.BOF) Then
' Data found...
tjessejeff,
If you can post back the code you are now working with it will give us more of a clue as to where the problem is.
For recordsets I've always used :-
If Not (rs.EOF And rs.BOF)
'data exists
Else
'No Data Found
EndIf
Regards, Nick
How about :-
cSql = "SELECT name FROM sysobjects WHERE name = 'MyTable'"
Set rs = Db.OpenResultset( etc etc - make ADO recordset)
If Not (rs.EOF and rs.BOF) Then
'Table name exists, show user message
Else
'Table does not exist
Endif
Hope this helps.
Regards, Nick
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.