SunQuest
           Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 29th, 2003, 05:19 PM
rkern rkern is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 33 rkern User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
passing global vars into SQL2K

using VB, have a global variable -> busDate

using a recordset, the query is:
SQLQuery3 = "CREATE TABLE [WBS].[dbo].[sgrp_temp] ([Rpt_Level] int NULL,[BusDate] smalldatetime DEFAULT 'busdate',[Number] int NULL, [Desc] varchar (20) NULL,[SysDate] smalldatetime DEFAULT getdate(),[AutoNbr] uniqueidentifier)"
rstAll.Open SQLQuery3, cnWBS

the problem is the DEFAULT declaration for BusDate, I'm not getting the value of the variable passed in. The default for SysDate does work. How should the global var be referenced?


Comments appreciated
Thanks
RK

Reply With Quote
  #2  
Old July 29th, 2003, 05:49 PM
rkern rkern is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 33 rkern User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
have also tried the following, creating the connection etc all done before. The error is that the item is not found in the collection


Cmd.CommandText = "CREATE TABLE [WBS].[dbo].[sgrp_temp] ([Rpt_Level] int NULL,[BusDate] smalldatetime DEFAULT '?',[Number] int NULL,[Descript] varchar (18) NULL,[Ct] decimal (2,0) NULL,[Amount] smallmoney NULL,[SysDate] smalldatetime DEFAULT getdate(),[AutoNbr] uniqueidentifier)"
Cmd.Parameters.Refresh
Cmd.Parameters(0) = BusDate

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > passing global vars into SQL2K


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway