SQL Date

ADO

    Next

  • 1. Row cannot be located for updating error
    I'm receiving the "Row cannot be located for updating. Some values may have been changed since it was last read." error in ADO. dest.Open "select * from " & desttable & " where " & pkname & " = " & pk, cn, adOpenDynamic, adLockOptimistic (pkname is the name of the field that is the primary key, the pk is the value of the primary key) Then populate each field from a source record, then... dest.Update Which is where I get the error. The database is oracle 8i, and I have a trigger on the table that updates a field in the table. If I take the trigger out for one partiuclar field it works fine. I have triggers other places that update fields (like the primary key on an insert) in the record and they dont seem to cause a problem. Anyone have this problem? -A
  • 2. OLTP
    How to utilize vb,crystal and sqlo server for OLTP
  • 3. Server Explorer not working. I think ADO issue. Help!
    HELP!!! I have VS 2003 Enterprise Architect installed on a Windows 2003 server. I noticed yesterday that when I go into the Server Explorer tab that none of the connections work. When I right click on of them and select modify if says that the Data Source Locator is missing and to reinstall VS. So I did a complete uninstall and reinstall and it does the same thing. I looked around on the internet and others have had this problem. They said to reinstall ADO which I did by installing mdac 2.8 but it didn't help. I think one of the Microsoft updates must have broke something somewhere. Any ideas? I am totally desperate. Thanks!
  • 4. MSDataShape: Why are updates so slow?
    I work on an application in Visual Basic 6. I have a problem when using recordsets created with MSDataShape (connection string is "Provider=MSDataShape;Data Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & fp_DataBaseFilePath & ";"). The problem is, updating the recordset is very slow! For example, updating about 2000 records in a recordset takes about 4 seconds. When using jet directly (connection string is "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & fp_DataBaseFilePath & ";"), the same operation takes about 0.2 seconds. But in some occasions I need to use MSDataShape. Do you have an idea why the updates are so slow? Thanks! Uri (speedy99).

SQL Date

Postby Martin Wilkins » Tue, 30 Sep 2003 20:47:22 GMT

Hi

How do you write an SQL statement that retrieves the date from a date field
I'm using SQL Server 2000.

Ex
Select Date from Articles where Date=01/04/2003

-- 
Martin



Re: SQL Date

Postby Victor Koch » Tue, 30 Sep 2003 23:54:25 GMT

Hi Martin try this

Select Date from Articles where Date='2003-01-04'

Date format YYYY-MM-DD


"Martin Wilkins" < XXXX@XXXXX.COM > escribien el mensaje


>> Hi
>>
>> How do you write an SQL statement that retrieves the date from a date
field
>> I'm using SQL Server 2000.
>>
>> Ex
>> Select Date from Articles where Date=01/04/2003
>>
>> --
>> Martin
>>
>>



Re: SQL Date

Postby Jerry III » Tue, 30 Sep 2003 23:57:34 GMT

SELECT [Date] FROM [Articles] WHERE [Date] = '20030104'

Sql server will always recognize 'YYYYMMDD' regardless of your locale
setting. Of course it's just easier to use a Command object and pass the
date as a parameter and let the provider worry about the right format.

Jerry





field



Re: SQL Date

Postby Val Mazur » Wed, 01 Oct 2003 11:37:15 GMT

Hi Martin,

Default format for SQL Server is MM/DD/YYYY and you need to enclose your
date into single quotes. You also should be aware that Date is a reserved
word and you need to wrap all reserved words into square brackets

Select [Date] from Articles where [Date]='01/04/2003'

-- 
Val Mazur
Microsoft MVP
Check Virus Alert, stay updated
 http://www.**--****.com/ 






field




Return to ADO

 

Who is online

Users browsing this forum: No registered users and 89 guest