Anda di halaman 1dari 2

sign up

Questions

log in

tour

Documentation Beta

Jobs

help

Search Q&A

Tags

Users

Badges

Ask Question

x Dismiss

Join the Stack Overflow Community


Stack Overflow is a community of 6.3 million
programmers, just like you, helping each other.
Join them it only takes a minute:

Sign up

Basic4Android sql1 update


asked

3 years ago

viewed 1233 times


active

9 months ago

I am stuck using basic4android as regards updating a record in a sql db (Lover.db). This works:
UPCOMING EVENTS

SQLLover.ExecNonQuery("UPDATE Profiles SET Mobile ='Nos', " & _


"Name = 'Nme', Sunday = 'SundayX', Monday = 'MondayX', " & _
"Tuesday = 'TuesdayX', Wednesday = 'WednesdayX', Thursday = 'ThursdayX', " & _
" Friday = 'FridayX', Saturday = 'SaturdayX', " & _
"StartTime = 'lblTimeFrom.text', EndTime = 'lblTimeTo.Text' " & _
"WHERE Mobile='07xxxxxxxxx' AND Name='Sam'")

2016 Community Moderator Election


ends in 6 days
BLOG

How We Make Money at Stack


Overflow: 2016 Edition

But of course the just updates with the data in the single quotes. I want to used some variables, and
have tried this
SQLLover.ExecNonQuery2("Update Profiles SET(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", & _
Array As Object(Nos, Nme, SundayX, MondayX, TuesdayX, WednesdayX, & _
ThursdayX, FridayX, SaturdayX, lblTimeFrom.Text, lblTimeTo.Text))

Work from anywhere


Ruby on Rails Developer
Toptal

Is this the correct syntax? Of coures, Nos , Nme , SundayX etc are my variables.

No office location

$48,000 - $96,000

basic4android

share improve this question

ruby-on-rails
edited Jan 20 '13 at 1:19

asked Jan 19 '13 at 16:32

That Brazilian Guy

user1993185

972

12

33

Software Engineering Manager - $100k


Crossover

active

oldest

votes

c#

Full Stack Chief Architect with Test


Automation
Crossover

No office location

REMOTE

.net

2 Answers

REMOTE

postgresql

Your UPDATE syntax is entirely wrong. The correct syntax is UPDATE table SET column = value,
column2 = value2 and so forth. You've done nothing even remotely close to that with your code. I'm
not going to bother to type out the whole thing, but I'll do enough to get you started:

No office location

REMOTE

test-automation

selenium

C# (.NET) Software Architect - $60k


SQLLover.ExecNonQuery2("Update Profiles " & _
"SET Mobile = ?, Name = ?, Sunday = ?, Monday = ?", & _
Array As Object(Nos, Nme, SundayX, MondayX))

Crossover

.net

share improve this answer

tdd

answered Jan 19 '13 at 17:09

Ken White
95.1k

11

111

202

With your code, the working one, to be able to used variable in the query, you have to escape the
query and concatenate the variable. Look at this short example

No office location

REMOTE

Related
0

Using custom styles with Basic4Android

Writing and reading variables in


Basic4Android

Do you always need to initialize in


basic4android?

How can I attach a label to a scrollview in


Basic4Android?

Finish all activities in Basic4Android

0
what is the way to install the basic4android
SQLLover.ExecNonQuery("UPDATE Profiles SET Mobile = ' " & NOs & " ', Name = ' "&NMe & " ' WHERE Name = ' " & OldNameVariable & " ' ")
0

basic4android
android.os.networkonmainthreadexception
error

Basic4android - Jsonparser

How to capture images automatically in


basic4android

Basic4Android Printing With ePOS SDK


Epson

SO TO USE VARIABLE Insert "& VARIABLENAME &" as in the example (Mobile = ' "& Nos &"')
HINT: The last query should look like this: AND Name=' " & SamOldVariableName & " ' ")
share improve this answer

answered Feb 12 at 15:18

boluvisako
16

Hot Network Questions

Formally can money be in a plural form (monies)


or not?

Your Answer

Higher up doesn't carry around their security


badge and asks others to let them in. What
should I do about this security issue?
Are human fetal cells used to produce Pepsi?
Controlling jet engine thrust on airliners
North by North by North by South East
Is it ethical to offer female candidates a higher
wage to achieve a more diverse work
environment?
Why are most pens (that we use to write) blue in
color?
What difficulty would the Roman Empire have
besieging a fantasy kingdom's 49m wall?
US Election results 2016: What went wrong with
prediction models?
Storing passwords in access-restricted Google
spreadsheets?

Sign up or log in

Post as a guest

Sign up using Google

Lucene analytics index constantly loads HDD


How to limit the power of "Find Steed" spell when
allowing other creatures to be summoned

Name

Managing Dearness

Sign up using Facebook

Word to describe object that can be physically


passed through

Email
required, but never shown

Sign up using Email and Password

Is a proof still valid if only the author understands


it?
Why do Internet forums tend to prohibit
responding to inactive threads?

Post Your Answer

more hot questions

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged

basic4android

or ask your own

question.
question feed

about us

tour

help

blog

chat

data

legal

privacy policy

work here

TECHNOLOGY
Stack Overflow
Server Fault
Super User
Web
Applications
Ask Ubuntu
Webmasters
Game
Development
TeX - LaTeX

advertising info

mobile

LIFE / ARTS
Software
Engineering

Database
Administrators

Unix & Linux

Drupal Answers

Ask Different
(Apple)

SharePoint

Signal
Processing

User Experience

Raspberry Pi

Mathematica

Programming
Puzzles & Code
Golf

WordPress
Development
Geographic
Information
Systems

Salesforce

Electrical
Engineering

Cryptography

ExpressionEngine
Answers

Code Review

Photography

Academia

Magento

Science
Fiction &
Fantasy

more (8)

more (7)

SCIENCE

English
Language &
Usage

Bicycles

MathOverflow

Philosophy

Role-playing
Games

Mathematics

more (3)

Skeptics
Mi Yodeya
(Judaism)

Movies & TV

Travel

Music: Practice
& Theory

Christianity

Seasoned
Advice
(cooking)
Home
Improvement

Information
Security

Personal
Finance &
Money

site design / logo 2016 Stack Exchange Inc user contributions licensed under cc by-sa 3.0 with attribution required

feedback

CULTURE / RECREATION

Graphic
Design

Android
Enthusiasts

rev 2016.11.16.4205

contact us

English
Language
Learners
Japanese
Language
Arqade
(gaming)

Anime &
Manga

Cross
Validated
(stats)

Motor Vehicle
Maintenance &
Repair

Theoretical
Computer
Science

more (17)

Physics
Chemistry
Biology
Computer
Science

OTHER
Meta Stack
Exchange
Stack Apps
Area 51
Stack
Overflow
Talent

Anda mungkin juga menyukai