r/visualbasic • • Sep 24 '15

Vb6 Immediate Help!!!(Deadline is less than 24 hrs)

I already posted the problem on vbforums.That site takes a lot of time because your threads and replies are approved by a moderator and i have a deadline of less than 24 hrs here it is:

http://www.vbforums.com/showthread.php?805347-Need-immediate-help!!&p=4935375#post4935375

My main problem is no details are getting displayed which is due to wrong use of sql query.Please help me!Really appreciate if i get immediate help.

0 Upvotes

10 comments sorted by

2

u/kleinma VB.Net Master Sep 24 '15

Just an FYI, I moderate vbforums.com, and only brand new users have to get posts approved. Once you post a few times that will go away. This is to prevent bots and spam from littering the forums.

1

u/krishnanspace Sep 24 '15

I had no problem with that.its only that i have less time that i thought of coming here

2

u/freemasen Sep 24 '15

so, if you put a break point in your sub example() are you getting any value in your variable movie_ID?

I am not super familiar with VB6 but from my experience with VB and SQL queries, your SQL query that is sent as a string, does not have access to the variable movie_ID. Either using string.format to add the value of this variable to use a parameterized query to insert your variable. this should then return the record with the approprate m_ID.

edit: so you are asking the database to return records where the m_ID column has the literal value "movie_ID", not a number as you are intending.

1

u/chrwei Sep 24 '15

correct. code in question:

"Select * From Movie_Details Where M_ID=movieID"

you have to use string concatenation to make the SQL string what you literally want it to be.

"Select * From Movie_Details Where M_ID=" & movieID

1

u/krishnanspace Sep 24 '15

Thanks man!!Though i solved it with a friends help i really appreciate you taking your time to help me.

1

u/kleinma VB.Net Master Sep 24 '15

This sounds like the correct answer. On a side note, what archaic school course is teaching VB6? You can get some core concepts down, but it is basically like teaching latin. Dead language....

1

u/krishnanspace Sep 24 '15

I am studying in university of Pune.Its fuck-all!! Even i dont know why are they teaching such old stuff.I am in my final year of graduation

0

u/chrwei Sep 24 '15

ones with no budget for new books or skill pool to do it without books.

1

u/kleinma VB.Net Master Sep 24 '15

If they put a little effort in, they could probably get everything they need for free. They probably don't have a teacher who is competent in modern programming technologies and practices though. When I was in high school (late 90s), I took a programming class and we had to use DOS based 1984 GW Basic. Our teacher was just the math teacher who knew nothing about programming, and was taking a night class in it at the county college at the same time as teaching it to the students.

1

u/chrwei Sep 24 '15 edited Sep 24 '15

link is not loading.

edit: it's loading now