troubleshooting Question

VB6 ADO SQL Server Question

Avatar of mossmis
mossmis asked on
Microsoft SQL ServerVisual Basic Classic
9 Comments3 Solutions750 ViewsLast Modified:
I have the following SQL statement I want to execute from within a VB6 App:

SELECT DATENAME(dd, GETDATE())+
left(CONVERT(VARCHAR(8), GETDATE(), 1),2)+
DATENAME(yyyy, GETDATE())+
DATENAME(hh, GETDATE())+
DATENAME(mi, GETDATE())+
DATENAME(ss, GETDATE()) + right(CONVERT(VARCHAR(23), GETDATE(), 121), 3)
AS DateGen


I am trying to get it to work with ADO and with examples I found on the web, I cannot figure out how to formulate it. I am connecting to SQL server 2008 via ODBC.  All I want to do is  return the "DateGen". Any help would be appreciated.
ASKER CERTIFIED SOLUTION
Brook Braswell
Application Development Manager

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros