|
-
Jun 17th, 2004, 03:06 AM
#1
Thread Starter
Addicted Member
Variables in databases
Hi, i am using variables in database but both times they dont work.
First example is, problem is there is no error message apart from sayin that its not there, so i knwo the syntax is A valid one but whether its right ?????
VB Code:
If cmdStartStop.Caption = "Stop Campaign" Then
NotRunning.Source = "Select * From T_Campaigns WHERE Campaign_Name = ' " & lstNotRunning.Text & " ' ;"
NotRunning.Open , db, adOpenKeyset, adLockOptimistic
With NotRunning
.Fields("Live").Value = "Not Running"
.Update
NotRunning.Close
Call ListLoad
End With
End If
and the second is on a different form but same thing, dont pick it up
VB Code:
If db Is Nothing Then OpenConnectionCampaign
Set CallBack = New ADODB.Recordset
CallBack.Open "SHAPE {SELECT & 'CallBackList' & FROM Data WHERE CallBack = 'True' } AS ParentCMD2 APPEND ({SELECT '& CallBackList &' FROM Data WHERE CallBack = 'True'} AS ChildCMD2 RELATE Telephone_Number TO Telephone_Number) AS ChildCMD2", db, adOpenStatic, adLockOptimistic
bCancelResult = False
Set grdDataGrid.DataSource = CallBack.DataSource
any idea's
tnx
-
Jun 17th, 2004, 03:51 AM
#2
Thread Starter
Addicted Member
??
-
Jun 17th, 2004, 04:16 AM
#3
Thread Starter
Addicted Member
lol i take it no1 know, coz it just aint pickin them up, i have tried different syntax but still nothing
-
Jun 17th, 2004, 04:32 AM
#4
Frenzied Member
VB Code:
NotRunning.Source = "Select * From T_Campaigns WHERE Campaign_Name = ' " & lstNotRunning.Text & " ' ;"
well this one is putting a SPACE either side of the variable so you won't find the Campaign_Name matching your variable - change it to:
VB Code:
NotRunning.Source = "Select * From T_Campaigns WHERE Campaign_Name = '" & lstNotRunning.Text & "' ;"
And
VB Code:
CallBack.Open "SHAPE {SELECT & 'CallBackList' & FROM Data WHERE CallBack = 'True' } AS ParentCMD2 APPEND ({SELECT '& CallBackList &' FROM Data WHERE CallBack = 'True'} AS ChildCMD2 RELATE Telephone_Number TO Telephone_Number) AS ChildCMD2", db, adOpenStatic, adLockOptimistic
With this one you are not 'breaking out' of the string to add your variable names in - try this
VB Code:
CallBack.Open "SHAPE {SELECT '" & CallBackList & "' FROM Data WHERE CallBack = 'True' } AS ParentCMD2 APPEND ({SELECT '" & CallBackList &"' FROM Data WHERE CallBack = 'True'} AS ChildCMD2 RELATE Telephone_Number TO Telephone_Number) AS ChildCMD2", db, adOpenStatic, adLockOptimistic
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
Jun 17th, 2004, 04:42 AM
#5
Thread Starter
Addicted Member
Unfortunatly still nothing on both

for the CallBack
Dim CallBackList As String
CallBackList = "Telephone_Number,DateOfCallBack"
i have checked spelling as well but still nothing.
and for the first one is it listbox.text to look at the selected item or is it something different
-
Jun 17th, 2004, 06:49 AM
#6
Thread Starter
Addicted Member
I still aint figured it out,any1 got any idea's or want any more info
-
Jun 17th, 2004, 08:58 AM
#7
Thread Starter
Addicted Member
how do i use the listview.text, im sure whether that is right ?
-
Jun 18th, 2004, 03:47 AM
#8
Thread Starter
Addicted Member
Ok, i still aint figure it out but if i show it 1 by 1, you might be able to help
VB Code:
Dim CallBackList As String
CallBackList = "Telephone_Number,DateOfCallBack"
Set db = Nothing
If db Is Nothing Then OpenConnectionCampaign
Set CallBack = New ADODB.Recordset
CallBack.Open "SHAPE {SELECT '" & CallBackList & "' FROM Data WHERE CallBack = 'True' } AS ParentCMD2 APPEND ({SELECT '" & CallBackList & "' FROM Data WHERE CallBack = 'True'} AS ChildCMD2 RELATE Telephone_Number TO Telephone_Number) AS ChildCMD2", db, adOpenStatic, adLockOptimistic
bCancelResult = False
Set grdDataGrid.DataSource = CallBack.DataSource
That is the first one and the other one i have resovled
Last edited by k0r54; Jun 18th, 2004 at 03:51 AM.
-
Jun 18th, 2004, 04:16 AM
#9
Thread Starter
Addicted Member
The error i am gettin is
Column (Telephone_Number) does not exist in the appropraite row set.
Im not sure what this means but, all fields are field in.
im goin with this
any help will be great cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|